Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_CONTAINERS_FLAT_MAP_H_ | 5 #ifndef BASE_CONTAINERS_FLAT_MAP_H_ |
| 6 #define BASE_CONTAINERS_FLAT_MAP_H_ | 6 #define BASE_CONTAINERS_FLAT_MAP_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/containers/flat_tree.h" | 10 #include "base/containers/flat_tree.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 flat_map(); | 138 flat_map(); |
| 139 explicit flat_map(const Compare& comp); | 139 explicit flat_map(const Compare& comp); |
| 140 | 140 |
| 141 // Not stable in the presence of duplicates in the initializer list. | 141 // Not stable in the presence of duplicates in the initializer list. |
| 142 template <class InputIterator> | 142 template <class InputIterator> |
| 143 flat_map(InputIterator first, | 143 flat_map(InputIterator first, |
| 144 InputIterator last, | 144 InputIterator last, |
| 145 const Compare& comp = Compare()); | 145 const Compare& comp = Compare()); |
| 146 | 146 |
| 147 flat_map(const flat_map&); | 147 flat_map(const flat_map&); |
| 148 flat_map(flat_map&&); | 148 flat_map(flat_map&&) noexcept; |
| 149 | 149 |
| 150 // Not stable in the presence of duplicates in the initializer list. | 150 // Not stable in the presence of duplicates in the initializer list. |
| 151 flat_map(std::initializer_list<value_type> ilist, | 151 flat_map(std::initializer_list<value_type> ilist, |
| 152 const Compare& comp = Compare()); | 152 const Compare& comp = Compare()); |
| 153 | 153 |
| 154 ~flat_map(); | 154 ~flat_map(); |
| 155 | 155 |
| 156 // -------------------------------------------------------------------------- | 156 // -------------------------------------------------------------------------- |
| 157 // Assignments. | 157 // Assignments. |
| 158 // | 158 // |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 template <class InputIterator> | 197 template <class InputIterator> |
| 198 flat_map<Key, Mapped, Compare>::flat_map(InputIterator first, | 198 flat_map<Key, Mapped, Compare>::flat_map(InputIterator first, |
| 199 InputIterator last, | 199 InputIterator last, |
| 200 const Compare& comp) | 200 const Compare& comp) |
| 201 : tree(first, last, comp) {} | 201 : tree(first, last, comp) {} |
| 202 | 202 |
| 203 template <class Key, class Mapped, class Compare> | 203 template <class Key, class Mapped, class Compare> |
| 204 flat_map<Key, Mapped, Compare>::flat_map(const flat_map&) = default; | 204 flat_map<Key, Mapped, Compare>::flat_map(const flat_map&) = default; |
| 205 | 205 |
| 206 template <class Key, class Mapped, class Compare> | 206 template <class Key, class Mapped, class Compare> |
| 207 flat_map<Key, Mapped, Compare>::flat_map(flat_map&&) = default; | 207 flat_map<Key, Mapped, Compare>::flat_map(flat_map&&) noexcept = default; |
|
brucedawson
2017/03/22 21:39:05
That reads weird, as if you are setting noexcept t
| |
| 208 | 208 |
| 209 template <class Key, class Mapped, class Compare> | 209 template <class Key, class Mapped, class Compare> |
| 210 flat_map<Key, Mapped, Compare>::flat_map( | 210 flat_map<Key, Mapped, Compare>::flat_map( |
| 211 std::initializer_list<value_type> ilist, | 211 std::initializer_list<value_type> ilist, |
| 212 const Compare& comp) | 212 const Compare& comp) |
| 213 : flat_map(std::begin(ilist), std::end(ilist), comp) {} | 213 : flat_map(std::begin(ilist), std::end(ilist), comp) {} |
| 214 | 214 |
| 215 template <class Key, class Mapped, class Compare> | 215 template <class Key, class Mapped, class Compare> |
| 216 flat_map<Key, Mapped, Compare>::~flat_map() = default; | 216 flat_map<Key, Mapped, Compare>::~flat_map() = default; |
| 217 | 217 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 // General operations. | 257 // General operations. |
| 258 | 258 |
| 259 template <class Key, class Mapped, class Compare> | 259 template <class Key, class Mapped, class Compare> |
| 260 void flat_map<Key, Mapped, Compare>::swap(flat_map& other) { | 260 void flat_map<Key, Mapped, Compare>::swap(flat_map& other) { |
| 261 tree::swap(other); | 261 tree::swap(other); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace base | 264 } // namespace base |
| 265 | 265 |
| 266 #endif // BASE_CONTAINERS_FLAT_MAP_H_ | 266 #endif // BASE_CONTAINERS_FLAT_MAP_H_ |
| OLD | NEW |