tmp/tmph9m_cw83/{from.md → to.md}
RENAMED
|
@@ -6,18 +6,18 @@ An `unordered_multimap` is an unordered associative container that
|
|
| 6 |
supports equivalent keys (an instance of `unordered_multimap` may
|
| 7 |
contain multiple copies of each key value) and that associates values of
|
| 8 |
another type `mapped_type` with the keys. The `unordered_multimap` class
|
| 9 |
supports forward iterators.
|
| 10 |
|
| 11 |
-
An `unordered_multimap` meets all of the requirements of a container
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
the `
|
| 17 |
-
|
| 18 |
-
`pair<const Key, T>`.
|
| 19 |
|
| 20 |
Subclause [[unord.multimap]] only describes operations on
|
| 21 |
`unordered_multimap` that are not described in one of the requirement
|
| 22 |
tables, or for which there is additional semantic information.
|
| 23 |
|
|
@@ -39,12 +39,12 @@ namespace std {
|
|
| 39 |
using allocator_type = Allocator;
|
| 40 |
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 41 |
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 42 |
using reference = value_type&;
|
| 43 |
using const_reference = const value_type&;
|
| 44 |
-
using size_type = implementation-defined; // see [container.requirements]
|
| 45 |
-
using difference_type = implementation-defined; // see [container.requirements]
|
| 46 |
|
| 47 |
using iterator = implementation-defined // type of unordered_multimap::iterator; // see [container.requirements]
|
| 48 |
using const_iterator = implementation-defined // type of unordered_multimap::const_iterator; // see [container.requirements]
|
| 49 |
using local_iterator = implementation-defined // type of unordered_multimap::local_iterator; // see [container.requirements]
|
| 50 |
using const_local_iterator = implementation-defined // type of unordered_multimap::const_local_iterator; // see [container.requirements]
|
|
@@ -60,15 +60,21 @@ namespace std {
|
|
| 60 |
unordered_multimap(InputIterator f, InputIterator l,
|
| 61 |
size_type n = see below,
|
| 62 |
const hasher& hf = hasher(),
|
| 63 |
const key_equal& eql = key_equal(),
|
| 64 |
const allocator_type& a = allocator_type());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
unordered_multimap(const unordered_multimap&);
|
| 66 |
unordered_multimap(unordered_multimap&&);
|
| 67 |
explicit unordered_multimap(const Allocator&);
|
| 68 |
-
unordered_multimap(const unordered_multimap&, const Allocator&);
|
| 69 |
-
unordered_multimap(unordered_multimap&&, const Allocator&);
|
| 70 |
unordered_multimap(initializer_list<value_type> il,
|
| 71 |
size_type n = see below,
|
| 72 |
const hasher& hf = hasher(),
|
| 73 |
const key_equal& eql = key_equal(),
|
| 74 |
const allocator_type& a = allocator_type());
|
|
@@ -81,10 +87,18 @@ namespace std {
|
|
| 81 |
: unordered_multimap(f, l, n, hasher(), key_equal(), a) { }
|
| 82 |
template<class InputIterator>
|
| 83 |
unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
| 84 |
const allocator_type& a)
|
| 85 |
: unordered_multimap(f, l, n, hf, key_equal(), a) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
|
| 87 |
: unordered_multimap(il, n, hasher(), key_equal(), a) { }
|
| 88 |
unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 89 |
const allocator_type& a)
|
| 90 |
: unordered_multimap(il, n, hf, key_equal(), a) { }
|
|
@@ -118,20 +132,24 @@ namespace std {
|
|
| 118 |
template<class P> iterator insert(P&& obj);
|
| 119 |
iterator insert(const_iterator hint, const value_type& obj);
|
| 120 |
iterator insert(const_iterator hint, value_type&& obj);
|
| 121 |
template<class P> iterator insert(const_iterator hint, P&& obj);
|
| 122 |
template<class InputIterator> void insert(InputIterator first, InputIterator last);
|
|
|
|
|
|
|
| 123 |
void insert(initializer_list<value_type>);
|
| 124 |
|
| 125 |
node_type extract(const_iterator position);
|
| 126 |
node_type extract(const key_type& x);
|
|
|
|
| 127 |
iterator insert(node_type&& nh);
|
| 128 |
iterator insert(const_iterator hint, node_type&& nh);
|
| 129 |
|
| 130 |
iterator erase(iterator position);
|
| 131 |
iterator erase(const_iterator position);
|
| 132 |
size_type erase(const key_type& k);
|
|
|
|
| 133 |
iterator erase(const_iterator first, const_iterator last);
|
| 134 |
void swap(unordered_multimap&)
|
| 135 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 136 |
is_nothrow_swappable_v<Hash> &&
|
| 137 |
is_nothrow_swappable_v<Pred>);
|
|
@@ -198,10 +216,18 @@ namespace std {
|
|
| 198 |
typename see below::size_type = see below,
|
| 199 |
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
| 200 |
-> unordered_multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>,
|
| 201 |
Hash, Pred, Allocator>;
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
template<class Key, class T, class Hash = hash<Key>,
|
| 204 |
class Pred = equal_to<Key>, class Allocator = allocator<pair<const Key, T>>>
|
| 205 |
unordered_multimap(initializer_list<pair<Key, T>>,
|
| 206 |
typename see below::size_type = see below,
|
| 207 |
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
|
@@ -223,10 +249,25 @@ namespace std {
|
|
| 223 |
unordered_multimap(InputIterator, InputIterator, typename see below::size_type, Hash,
|
| 224 |
Allocator)
|
| 225 |
-> unordered_multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>, Hash,
|
| 226 |
equal_to<iter-key-type<InputIterator>>, Allocator>;
|
| 227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
template<class Key, class T, class Allocator>
|
| 229 |
unordered_multimap(initializer_list<pair<Key, T>>, typename see below::size_type,
|
| 230 |
Allocator)
|
| 231 |
-> unordered_multimap<Key, T, hash<Key>, equal_to<Key>, Allocator>;
|
| 232 |
|
|
@@ -236,16 +277,10 @@ namespace std {
|
|
| 236 |
|
| 237 |
template<class Key, class T, class Hash, class Allocator>
|
| 238 |
unordered_multimap(initializer_list<pair<Key, T>>, typename see below::size_type,
|
| 239 |
Hash, Allocator)
|
| 240 |
-> unordered_multimap<Key, T, Hash, equal_to<Key>, Allocator>;
|
| 241 |
-
|
| 242 |
-
// swap
|
| 243 |
-
template<class Key, class T, class Hash, class Pred, class Alloc>
|
| 244 |
-
void swap(unordered_multimap<Key, T, Hash, Pred, Alloc>& x,
|
| 245 |
-
unordered_multimap<Key, T, Hash, Pred, Alloc>& y)
|
| 246 |
-
noexcept(noexcept(x.swap(y)));
|
| 247 |
}
|
| 248 |
```
|
| 249 |
|
| 250 |
A `size_type` parameter type in an `unordered_multimap` deduction guide
|
| 251 |
refers to the `size_type` member type of the type deduced by the
|
|
@@ -273,10 +308,16 @@ template<class InputIterator>
|
|
| 273 |
unordered_multimap(InputIterator f, InputIterator l,
|
| 274 |
size_type n = see below,
|
| 275 |
const hasher& hf = hasher(),
|
| 276 |
const key_equal& eql = key_equal(),
|
| 277 |
const allocator_type& a = allocator_type());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
unordered_multimap(initializer_list<value_type> il,
|
| 279 |
size_type n = see below,
|
| 280 |
const hasher& hf = hasher(),
|
| 281 |
const key_equal& eql = key_equal(),
|
| 282 |
const allocator_type& a = allocator_type());
|
|
@@ -284,12 +325,11 @@ unordered_multimap(initializer_list<value_type> il,
|
|
| 284 |
|
| 285 |
*Effects:* Constructs an empty `unordered_multimap` using the specified
|
| 286 |
hash function, key equality predicate, and allocator, and using at least
|
| 287 |
`n` buckets. If `n` is not provided, the number of buckets is
|
| 288 |
*implementation-defined*. Then inserts elements from the range \[`f`,
|
| 289 |
-
`l`)
|
| 290 |
-
for the second form. `max_load_factor()` returns `1.0`.
|
| 291 |
|
| 292 |
*Complexity:* Average case linear, worst case quadratic.
|
| 293 |
|
| 294 |
#### Modifiers <a id="unord.multimap.modifiers">[[unord.multimap.modifiers]]</a>
|
| 295 |
|
|
|
|
| 6 |
supports equivalent keys (an instance of `unordered_multimap` may
|
| 7 |
contain multiple copies of each key value) and that associates values of
|
| 8 |
another type `mapped_type` with the keys. The `unordered_multimap` class
|
| 9 |
supports forward iterators.
|
| 10 |
|
| 11 |
+
An `unordered_multimap` meets all of the requirements of a container
|
| 12 |
+
[[container.reqmts]], of an allocator-aware container
|
| 13 |
+
[[container.alloc.reqmts]], and of an unordered associative container
|
| 14 |
+
[[unord.req]]. It provides the operations described in the preceding
|
| 15 |
+
requirements table for equivalent keys; that is, an `unordered_multimap`
|
| 16 |
+
supports the `a_eq` operations in that table, not the `a_uniq`
|
| 17 |
+
operations. For an `unordered_multimap<Key, T>` the `key_type` is `Key`,
|
| 18 |
+
the `mapped_type` is `T`, and the `value_type` is `pair<const Key, T>`.
|
| 19 |
|
| 20 |
Subclause [[unord.multimap]] only describes operations on
|
| 21 |
`unordered_multimap` that are not described in one of the requirement
|
| 22 |
tables, or for which there is additional semantic information.
|
| 23 |
|
|
|
|
| 39 |
using allocator_type = Allocator;
|
| 40 |
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 41 |
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 42 |
using reference = value_type&;
|
| 43 |
using const_reference = const value_type&;
|
| 44 |
+
using size_type = implementation-defined // type of unordered_multimap::size_type; // see [container.requirements]
|
| 45 |
+
using difference_type = implementation-defined // type of unordered_multimap::difference_type; // see [container.requirements]
|
| 46 |
|
| 47 |
using iterator = implementation-defined // type of unordered_multimap::iterator; // see [container.requirements]
|
| 48 |
using const_iterator = implementation-defined // type of unordered_multimap::const_iterator; // see [container.requirements]
|
| 49 |
using local_iterator = implementation-defined // type of unordered_multimap::local_iterator; // see [container.requirements]
|
| 50 |
using const_local_iterator = implementation-defined // type of unordered_multimap::const_local_iterator; // see [container.requirements]
|
|
|
|
| 60 |
unordered_multimap(InputIterator f, InputIterator l,
|
| 61 |
size_type n = see below,
|
| 62 |
const hasher& hf = hasher(),
|
| 63 |
const key_equal& eql = key_equal(),
|
| 64 |
const allocator_type& a = allocator_type());
|
| 65 |
+
template<container-compatible-range<value_type> R>
|
| 66 |
+
unordered_multimap(from_range_t, R&& rg,
|
| 67 |
+
size_type n = see below,
|
| 68 |
+
const hasher& hf = hasher(),
|
| 69 |
+
const key_equal& eql = key_equal(),
|
| 70 |
+
const allocator_type& a = allocator_type());
|
| 71 |
unordered_multimap(const unordered_multimap&);
|
| 72 |
unordered_multimap(unordered_multimap&&);
|
| 73 |
explicit unordered_multimap(const Allocator&);
|
| 74 |
+
unordered_multimap(const unordered_multimap&, const type_identity_t<Allocator>&);
|
| 75 |
+
unordered_multimap(unordered_multimap&&, const type_identity_t<Allocator>&);
|
| 76 |
unordered_multimap(initializer_list<value_type> il,
|
| 77 |
size_type n = see below,
|
| 78 |
const hasher& hf = hasher(),
|
| 79 |
const key_equal& eql = key_equal(),
|
| 80 |
const allocator_type& a = allocator_type());
|
|
|
|
| 87 |
: unordered_multimap(f, l, n, hasher(), key_equal(), a) { }
|
| 88 |
template<class InputIterator>
|
| 89 |
unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
| 90 |
const allocator_type& a)
|
| 91 |
: unordered_multimap(f, l, n, hf, key_equal(), a) { }
|
| 92 |
+
template<container-compatible-range<value_type> R>
|
| 93 |
+
unordered_multimap(from_range_t, R&& rg, size_type n, const allocator_type& a)
|
| 94 |
+
: unordered_multimap(from_range, std::forward<R>(rg),
|
| 95 |
+
n, hasher(), key_equal(), a) { }
|
| 96 |
+
template<container-compatible-range<value_type> R>
|
| 97 |
+
unordered_multimap(from_range_t, R&& rg, size_type n, const hasher& hf,
|
| 98 |
+
const allocator_type& a)
|
| 99 |
+
: unordered_multimap(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { }
|
| 100 |
unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
|
| 101 |
: unordered_multimap(il, n, hasher(), key_equal(), a) { }
|
| 102 |
unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 103 |
const allocator_type& a)
|
| 104 |
: unordered_multimap(il, n, hf, key_equal(), a) { }
|
|
|
|
| 132 |
template<class P> iterator insert(P&& obj);
|
| 133 |
iterator insert(const_iterator hint, const value_type& obj);
|
| 134 |
iterator insert(const_iterator hint, value_type&& obj);
|
| 135 |
template<class P> iterator insert(const_iterator hint, P&& obj);
|
| 136 |
template<class InputIterator> void insert(InputIterator first, InputIterator last);
|
| 137 |
+
template<container-compatible-range<value_type> R>
|
| 138 |
+
void insert_range(R&& rg);
|
| 139 |
void insert(initializer_list<value_type>);
|
| 140 |
|
| 141 |
node_type extract(const_iterator position);
|
| 142 |
node_type extract(const key_type& x);
|
| 143 |
+
template<class K> node_type extract(K&& x);
|
| 144 |
iterator insert(node_type&& nh);
|
| 145 |
iterator insert(const_iterator hint, node_type&& nh);
|
| 146 |
|
| 147 |
iterator erase(iterator position);
|
| 148 |
iterator erase(const_iterator position);
|
| 149 |
size_type erase(const key_type& k);
|
| 150 |
+
template<class K> size_type erase(K&& x);
|
| 151 |
iterator erase(const_iterator first, const_iterator last);
|
| 152 |
void swap(unordered_multimap&)
|
| 153 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 154 |
is_nothrow_swappable_v<Hash> &&
|
| 155 |
is_nothrow_swappable_v<Pred>);
|
|
|
|
| 216 |
typename see below::size_type = see below,
|
| 217 |
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
| 218 |
-> unordered_multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>,
|
| 219 |
Hash, Pred, Allocator>;
|
| 220 |
|
| 221 |
+
template<ranges::input_range R,
|
| 222 |
+
class Hash = hash<range-key-type<R>>,
|
| 223 |
+
class Pred = equal_to<range-key-type<R>>,
|
| 224 |
+
class Allocator = allocator<range-to-alloc-type<R>>>
|
| 225 |
+
unordered_multimap(from_range_t, R&&, typename see below::size_type = see below,
|
| 226 |
+
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
| 227 |
+
-> unordered_multimap<range-key-type<R>, range-mapped-type<R>, Hash, Pred, Allocator>;
|
| 228 |
+
|
| 229 |
template<class Key, class T, class Hash = hash<Key>,
|
| 230 |
class Pred = equal_to<Key>, class Allocator = allocator<pair<const Key, T>>>
|
| 231 |
unordered_multimap(initializer_list<pair<Key, T>>,
|
| 232 |
typename see below::size_type = see below,
|
| 233 |
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
|
|
|
| 249 |
unordered_multimap(InputIterator, InputIterator, typename see below::size_type, Hash,
|
| 250 |
Allocator)
|
| 251 |
-> unordered_multimap<iter-key-type<InputIterator>, iter-mapped-type<InputIterator>, Hash,
|
| 252 |
equal_to<iter-key-type<InputIterator>>, Allocator>;
|
| 253 |
|
| 254 |
+
template<ranges::input_range R, class Allocator>
|
| 255 |
+
unordered_multimap(from_range_t, R&&, typename see below::size_type, Allocator)
|
| 256 |
+
-> unordered_multimap<range-key-type<R>, range-mapped-type<R>, hash<range-key-type<R>>,
|
| 257 |
+
equal_to<range-key-type<R>>, Allocator>;
|
| 258 |
+
|
| 259 |
+
template<ranges::input_range R, class Allocator>
|
| 260 |
+
unordered_multimap(from_range_t, R&&, Allocator)
|
| 261 |
+
-> unordered_multimap<range-key-type<R>, range-mapped-type<R>, hash<range-key-type<R>>,
|
| 262 |
+
equal_to<range-key-type<R>>, Allocator>;
|
| 263 |
+
|
| 264 |
+
template<ranges::input_range R, class Hash, class Allocator>
|
| 265 |
+
unordered_multimap(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
|
| 266 |
+
-> unordered_multimap<range-key-type<R>, range-mapped-type<R>, Hash,
|
| 267 |
+
equal_to<range-key-type<R>>, Allocator>;
|
| 268 |
+
|
| 269 |
template<class Key, class T, class Allocator>
|
| 270 |
unordered_multimap(initializer_list<pair<Key, T>>, typename see below::size_type,
|
| 271 |
Allocator)
|
| 272 |
-> unordered_multimap<Key, T, hash<Key>, equal_to<Key>, Allocator>;
|
| 273 |
|
|
|
|
| 277 |
|
| 278 |
template<class Key, class T, class Hash, class Allocator>
|
| 279 |
unordered_multimap(initializer_list<pair<Key, T>>, typename see below::size_type,
|
| 280 |
Hash, Allocator)
|
| 281 |
-> unordered_multimap<Key, T, Hash, equal_to<Key>, Allocator>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 282 |
}
|
| 283 |
```
|
| 284 |
|
| 285 |
A `size_type` parameter type in an `unordered_multimap` deduction guide
|
| 286 |
refers to the `size_type` member type of the type deduced by the
|
|
|
|
| 308 |
unordered_multimap(InputIterator f, InputIterator l,
|
| 309 |
size_type n = see below,
|
| 310 |
const hasher& hf = hasher(),
|
| 311 |
const key_equal& eql = key_equal(),
|
| 312 |
const allocator_type& a = allocator_type());
|
| 313 |
+
template<container-compatible-range<value_type> R>
|
| 314 |
+
unordered_multimap(from_range_t, R&& rg,
|
| 315 |
+
size_type n = see below,
|
| 316 |
+
const hasher& hf = hasher(),
|
| 317 |
+
const key_equal& eql = key_equal(),
|
| 318 |
+
const allocator_type& a = allocator_type());
|
| 319 |
unordered_multimap(initializer_list<value_type> il,
|
| 320 |
size_type n = see below,
|
| 321 |
const hasher& hf = hasher(),
|
| 322 |
const key_equal& eql = key_equal(),
|
| 323 |
const allocator_type& a = allocator_type());
|
|
|
|
| 325 |
|
| 326 |
*Effects:* Constructs an empty `unordered_multimap` using the specified
|
| 327 |
hash function, key equality predicate, and allocator, and using at least
|
| 328 |
`n` buckets. If `n` is not provided, the number of buckets is
|
| 329 |
*implementation-defined*. Then inserts elements from the range \[`f`,
|
| 330 |
+
`l`), `rg`, or `il`, respectively. `max_load_factor()` returns `1.0`.
|
|
|
|
| 331 |
|
| 332 |
*Complexity:* Average case linear, worst case quadratic.
|
| 333 |
|
| 334 |
#### Modifiers <a id="unord.multimap.modifiers">[[unord.multimap.modifiers]]</a>
|
| 335 |
|