- tmp/tmp20vnsqui/{from.md → to.md} +126 -87
tmp/tmp20vnsqui/{from.md → to.md}
RENAMED
|
@@ -133,24 +133,25 @@ namespace std {
|
|
| 133 |
typedef std::pair<const Key, T> value_type;
|
| 134 |
typedef T mapped_type;
|
| 135 |
typedef Hash hasher;
|
| 136 |
typedef Pred key_equal;
|
| 137 |
typedef Allocator allocator_type;
|
| 138 |
-
typedef typename
|
| 139 |
-
typedef typename
|
| 140 |
-
typedef
|
| 141 |
-
typedef
|
| 142 |
typedef implementation-defined size_type;
|
| 143 |
typedef implementation-defined difference_type;
|
| 144 |
|
| 145 |
typedef implementation-defined iterator;
|
| 146 |
typedef implementation-defined const_iterator;
|
| 147 |
typedef implementation-defined local_iterator;
|
| 148 |
typedef implementation-defined const_local_iterator;
|
| 149 |
|
| 150 |
// construct/destroy/copy
|
| 151 |
-
|
|
|
|
| 152 |
const hasher& hf = hasher(),
|
| 153 |
const key_equal& eql = key_equal(),
|
| 154 |
const allocator_type& a = allocator_type());
|
| 155 |
template <class InputIterator>
|
| 156 |
unordered_map(InputIterator f, InputIterator l,
|
|
@@ -166,10 +167,26 @@ namespace std {
|
|
| 166 |
unordered_map(initializer_list<value_type>,
|
| 167 |
size_type = see below,
|
| 168 |
const hasher& hf = hasher(),
|
| 169 |
const key_equal& eql = key_equal(),
|
| 170 |
const allocator_type& a = allocator_type());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
~unordered_map();
|
| 172 |
unordered_map& operator=(const unordered_map&);
|
| 173 |
unordered_map& operator=(unordered_map&&);
|
| 174 |
unordered_map& operator=(initializer_list<value_type>);
|
| 175 |
allocator_type get_allocator() const noexcept;
|
|
@@ -254,19 +271,20 @@ namespace std {
|
|
| 254 |
```
|
| 255 |
|
| 256 |
#### `unordered_map` constructors <a id="unord.map.cnstr">[[unord.map.cnstr]]</a>
|
| 257 |
|
| 258 |
``` cpp
|
| 259 |
-
|
|
|
|
| 260 |
const hasher& hf = hasher(),
|
| 261 |
const key_equal& eql = key_equal(),
|
| 262 |
const allocator_type& a = allocator_type());
|
| 263 |
```
|
| 264 |
|
| 265 |
*Effects:* Constructs an empty `unordered_map` using the specified hash
|
| 266 |
function, key equality function, and allocator, and using at least *`n`*
|
| 267 |
-
buckets.
|
| 268 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 269 |
|
| 270 |
*Complexity:* Constant.
|
| 271 |
|
| 272 |
``` cpp
|
|
@@ -291,13 +309,13 @@ buckets. If *`n`* is not provided, the number of buckets is
|
|
| 291 |
``` cpp
|
| 292 |
mapped_type& operator[](const key_type& k);
|
| 293 |
mapped_type& operator[](key_type&& k);
|
| 294 |
```
|
| 295 |
|
| 296 |
-
*Requires:* `mapped_type` shall be `
|
| 297 |
-
operator, `key_type` shall be `
|
| 298 |
-
operator, `key_type` shall be `MoveConstructible`.
|
| 299 |
|
| 300 |
*Effects:* If the `unordered_map` does not already contain an element
|
| 301 |
whose key is equivalent to *`k`*, the first operator inserts the value
|
| 302 |
`value_type(k, mapped_type())` and the second operator inserts the value
|
| 303 |
`value_type(std::move(k), mapped_type())`.
|
|
@@ -323,44 +341,25 @@ is present.
|
|
| 323 |
``` cpp
|
| 324 |
template <class P>
|
| 325 |
pair<iterator, bool> insert(P&& obj);
|
| 326 |
```
|
| 327 |
|
| 328 |
-
*
|
| 329 |
-
|
| 330 |
-
*Effects:* Inserts `obj` converted to `value_type` if and only if there
|
| 331 |
-
is no element in the container with key equivalent to the key of
|
| 332 |
-
`value_type(obj)`.
|
| 333 |
-
|
| 334 |
-
*Returns:* The `bool` component of the returned `pair` object indicates
|
| 335 |
-
whether the insertion took place and the iterator component points to
|
| 336 |
-
the element with key equivalent to the key of `value_type(obj)`.
|
| 337 |
-
|
| 338 |
-
*Complexity:* Average case 𝑂(1), worst case 𝑂(`size()`).
|
| 339 |
|
| 340 |
*Remarks:* This signature shall not participate in overload resolution
|
| 341 |
-
unless `P` is
|
| 342 |
|
| 343 |
``` cpp
|
| 344 |
template <class P>
|
| 345 |
iterator insert(const_iterator hint, P&& obj);
|
| 346 |
```
|
| 347 |
|
| 348 |
-
*
|
| 349 |
-
|
| 350 |
-
*Effects:* Inserts `obj` converted to `value_type` if and only if there
|
| 351 |
-
is no element in the container with key equivalent to the key of
|
| 352 |
-
`value_type(obj)`. The iterator `hint` is a hint pointing to where the
|
| 353 |
-
search should start.
|
| 354 |
-
|
| 355 |
-
*Returns:* An iterator that points to the element with key equivalent to
|
| 356 |
-
the key of `value_type(obj)`.
|
| 357 |
-
|
| 358 |
-
*Complexity:* Average case 𝑂(1), worst case 𝑂(`size()`).
|
| 359 |
|
| 360 |
*Remarks:* This signature shall not participate in overload resolution
|
| 361 |
-
unless `P` is
|
| 362 |
|
| 363 |
#### `unordered_map` swap <a id="unord.map.swap">[[unord.map.swap]]</a>
|
| 364 |
|
| 365 |
``` cpp
|
| 366 |
template <class Key, class T, class Hash, class Pred, class Alloc>
|
|
@@ -408,24 +407,25 @@ namespace std {
|
|
| 408 |
typedef std::pair<const Key, T> value_type;
|
| 409 |
typedef T mapped_type;
|
| 410 |
typedef Hash hasher;
|
| 411 |
typedef Pred key_equal;
|
| 412 |
typedef Allocator allocator_type;
|
| 413 |
-
typedef typename
|
| 414 |
-
typedef typename
|
| 415 |
-
typedef
|
| 416 |
-
typedef
|
| 417 |
typedef implementation-defined size_type;
|
| 418 |
typedef implementation-defined difference_type;
|
| 419 |
|
| 420 |
typedef implementation-defined iterator;
|
| 421 |
typedef implementation-defined const_iterator;
|
| 422 |
typedef implementation-defined local_iterator;
|
| 423 |
typedef implementation-defined const_local_iterator;
|
| 424 |
|
| 425 |
// construct/destroy/copy
|
| 426 |
-
|
|
|
|
| 427 |
const hasher& hf = hasher(),
|
| 428 |
const key_equal& eql = key_equal(),
|
| 429 |
const allocator_type& a = allocator_type());
|
| 430 |
template <class InputIterator>
|
| 431 |
unordered_multimap(InputIterator f, InputIterator l,
|
|
@@ -441,10 +441,26 @@ namespace std {
|
|
| 441 |
unordered_multimap(initializer_list<value_type>,
|
| 442 |
size_type = see below,
|
| 443 |
const hasher& hf = hasher(),
|
| 444 |
const key_equal& eql = key_equal(),
|
| 445 |
const allocator_type& a = allocator_type());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 446 |
~unordered_multimap();
|
| 447 |
unordered_multimap& operator=(const unordered_multimap&);
|
| 448 |
unordered_multimap& operator=(unordered_multimap&&);
|
| 449 |
unordered_multimap& operator=(initializer_list<value_type>);
|
| 450 |
allocator_type get_allocator() const noexcept;
|
|
@@ -524,19 +540,20 @@ namespace std {
|
|
| 524 |
```
|
| 525 |
|
| 526 |
#### `unordered_multimap` constructors <a id="unord.multimap.cnstr">[[unord.multimap.cnstr]]</a>
|
| 527 |
|
| 528 |
``` cpp
|
| 529 |
-
|
|
|
|
| 530 |
const hasher& hf = hasher(),
|
| 531 |
const key_equal& eql = key_equal(),
|
| 532 |
const allocator_type& a = allocator_type());
|
| 533 |
```
|
| 534 |
|
| 535 |
*Effects:* Constructs an empty `unordered_multimap` using the specified
|
| 536 |
hash function, key equality function, and allocator, and using at least
|
| 537 |
-
*`n`* buckets.
|
| 538 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 539 |
|
| 540 |
*Complexity:* Constant.
|
| 541 |
|
| 542 |
``` cpp
|
|
@@ -561,39 +578,25 @@ hash function, key equality function, and allocator, and using at least
|
|
| 561 |
``` cpp
|
| 562 |
template <class P>
|
| 563 |
iterator insert(P&& obj);
|
| 564 |
```
|
| 565 |
|
| 566 |
-
*
|
| 567 |
-
|
| 568 |
-
*Effects:* Inserts `obj` converted to `value_type`.
|
| 569 |
-
|
| 570 |
-
*Returns:* An iterator that points to the element with key equivalent to
|
| 571 |
-
the key of `value_type(obj)`.
|
| 572 |
-
|
| 573 |
-
*Complexity:* Average case 𝑂(1), worst case 𝑂(`size()`).
|
| 574 |
|
| 575 |
*Remarks:* This signature shall not participate in overload resolution
|
| 576 |
-
unless `P` is
|
| 577 |
|
| 578 |
``` cpp
|
| 579 |
template <class P>
|
| 580 |
iterator insert(const_iterator hint, P&& obj);
|
| 581 |
```
|
| 582 |
|
| 583 |
-
*
|
| 584 |
-
|
| 585 |
-
*Effects:* Inserts `obj` converted to `value_type`. The iterator `hint`
|
| 586 |
-
is a hint pointing to where the search should start.
|
| 587 |
-
|
| 588 |
-
*Returns:* An iterator that points to the element with key equivalent to
|
| 589 |
-
the key of `value_type(obj)`.
|
| 590 |
-
|
| 591 |
-
*Complexity:* Average case 𝑂(1), worst case 𝑂(`size()`).
|
| 592 |
|
| 593 |
*Remarks:* This signature shall not participate in overload resolution
|
| 594 |
-
unless `P` is
|
| 595 |
|
| 596 |
#### `unordered_multimap` swap <a id="unord.multimap.swap">[[unord.multimap.swap]]</a>
|
| 597 |
|
| 598 |
``` cpp
|
| 599 |
template <class Key, class T, class Hash, class Pred, class Alloc>
|
|
@@ -639,24 +642,25 @@ namespace std {
|
|
| 639 |
typedef Key key_type;
|
| 640 |
typedef Key value_type;
|
| 641 |
typedef Hash hasher;
|
| 642 |
typedef Pred key_equal;
|
| 643 |
typedef Allocator allocator_type;
|
| 644 |
-
typedef typename
|
| 645 |
-
typedef typename
|
| 646 |
-
typedef
|
| 647 |
-
typedef
|
| 648 |
typedef implementation-defined size_type;
|
| 649 |
typedef implementation-defined difference_type;
|
| 650 |
|
| 651 |
typedef implementation-defined iterator;
|
| 652 |
typedef implementation-defined const_iterator;
|
| 653 |
typedef implementation-defined local_iterator;
|
| 654 |
typedef implementation-defined const_local_iterator;
|
| 655 |
|
| 656 |
// construct/destroy/copy
|
| 657 |
-
|
|
|
|
| 658 |
const hasher& hf = hasher(),
|
| 659 |
const key_equal& eql = key_equal(),
|
| 660 |
const allocator_type& a = allocator_type());
|
| 661 |
template <class InputIterator>
|
| 662 |
unordered_set(InputIterator f, InputIterator l,
|
|
@@ -672,10 +676,26 @@ namespace std {
|
|
| 672 |
unordered_set(initializer_list<value_type>,
|
| 673 |
size_type = see below,
|
| 674 |
const hasher& hf = hasher(),
|
| 675 |
const key_equal& eql = key_equal(),
|
| 676 |
const allocator_type& a = allocator_type());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 677 |
~unordered_set();
|
| 678 |
unordered_set& operator=(const unordered_set&);
|
| 679 |
unordered_set& operator=(unordered_set&&);
|
| 680 |
unordered_set& operator=(initializer_list<value_type>);
|
| 681 |
allocator_type get_allocator() const noexcept;
|
|
@@ -743,31 +763,32 @@ namespace std {
|
|
| 743 |
|
| 744 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 745 |
void swap(unordered_set<Key, Hash, Pred, Alloc>& x,
|
| 746 |
unordered_set<Key, Hash, Pred, Alloc>& y);
|
| 747 |
|
| 748 |
-
template <class Key, class
|
| 749 |
-
bool operator==(const unordered_set<Key,
|
| 750 |
-
const unordered_set<Key,
|
| 751 |
-
template <class Key, class
|
| 752 |
-
bool operator!=(const unordered_set<Key,
|
| 753 |
-
const unordered_set<Key,
|
| 754 |
}
|
| 755 |
```
|
| 756 |
|
| 757 |
#### `unordered_set` constructors <a id="unord.set.cnstr">[[unord.set.cnstr]]</a>
|
| 758 |
|
| 759 |
``` cpp
|
| 760 |
-
|
|
|
|
| 761 |
const hasher& hf = hasher(),
|
| 762 |
const key_equal& eql = key_equal(),
|
| 763 |
const allocator_type& a = allocator_type());
|
| 764 |
```
|
| 765 |
|
| 766 |
*Effects:* Constructs an empty `unordered_set` using the specified hash
|
| 767 |
function, key equality function, and allocator, and using at least *`n`*
|
| 768 |
-
buckets.
|
| 769 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 770 |
|
| 771 |
*Complexity:* Constant.
|
| 772 |
|
| 773 |
``` cpp
|
|
@@ -834,24 +855,25 @@ namespace std {
|
|
| 834 |
typedef Key key_type;
|
| 835 |
typedef Key value_type;
|
| 836 |
typedef Hash hasher;
|
| 837 |
typedef Pred key_equal;
|
| 838 |
typedef Allocator allocator_type;
|
| 839 |
-
typedef typename
|
| 840 |
-
typedef typename
|
| 841 |
-
typedef
|
| 842 |
-
typedef
|
| 843 |
typedef implementation-defined size_type;
|
| 844 |
typedef implementation-defined difference_type;
|
| 845 |
|
| 846 |
typedef implementation-defined iterator;
|
| 847 |
typedef implementation-defined const_iterator;
|
| 848 |
typedef implementation-defined local_iterator;
|
| 849 |
typedef implementation-defined const_local_iterator;
|
| 850 |
|
| 851 |
// construct/destroy/copy
|
| 852 |
-
|
|
|
|
| 853 |
const hasher& hf = hasher(),
|
| 854 |
const key_equal& eql = key_equal(),
|
| 855 |
const allocator_type& a = allocator_type());
|
| 856 |
template <class InputIterator>
|
| 857 |
unordered_multiset(InputIterator f, InputIterator l,
|
|
@@ -867,13 +889,29 @@ namespace std {
|
|
| 867 |
unordered_multiset(initializer_list<value_type>,
|
| 868 |
size_type = see below,
|
| 869 |
const hasher& hf = hasher(),
|
| 870 |
const key_equal& eql = key_equal(),
|
| 871 |
const allocator_type& a = allocator_type());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 872 |
~unordered_multiset();
|
| 873 |
unordered_multiset& operator=(const unordered_multiset&);
|
| 874 |
-
unordered_multiset operator=(unordered_multiset&&);
|
| 875 |
unordered_multiset& operator=(initializer_list<value_type>);
|
| 876 |
allocator_type get_allocator() const noexcept;
|
| 877 |
|
| 878 |
// size and capacity
|
| 879 |
bool empty() const noexcept;
|
|
@@ -937,31 +975,32 @@ namespace std {
|
|
| 937 |
};
|
| 938 |
|
| 939 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 940 |
void swap(unordered_multiset<Key, Hash, Pred, Alloc>& x,
|
| 941 |
unordered_multiset<Key, Hash, Pred, Alloc>& y);
|
| 942 |
-
template <class Key, class
|
| 943 |
-
bool operator==(const unordered_multiset<Key,
|
| 944 |
-
const unordered_multiset<Key,
|
| 945 |
-
template <class Key, class
|
| 946 |
-
bool operator!=(const unordered_multiset<Key,
|
| 947 |
-
const unordered_multiset<Key,
|
| 948 |
}
|
| 949 |
```
|
| 950 |
|
| 951 |
#### `unordered_multiset` constructors <a id="unord.multiset.cnstr">[[unord.multiset.cnstr]]</a>
|
| 952 |
|
| 953 |
``` cpp
|
| 954 |
-
|
|
|
|
| 955 |
const hasher& hf = hasher(),
|
| 956 |
const key_equal& eql = key_equal(),
|
| 957 |
const allocator_type& a = allocator_type());
|
| 958 |
```
|
| 959 |
|
| 960 |
*Effects:* Constructs an empty `unordered_multiset` using the specified
|
| 961 |
hash function, key equality function, and allocator, and using at least
|
| 962 |
-
*`n`* buckets.
|
| 963 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 964 |
|
| 965 |
*Complexity:* Constant.
|
| 966 |
|
| 967 |
``` cpp
|
|
|
|
| 133 |
typedef std::pair<const Key, T> value_type;
|
| 134 |
typedef T mapped_type;
|
| 135 |
typedef Hash hasher;
|
| 136 |
typedef Pred key_equal;
|
| 137 |
typedef Allocator allocator_type;
|
| 138 |
+
typedef typename allocator_traits<Allocator>::pointer pointer;
|
| 139 |
+
typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
|
| 140 |
+
typedef value_type& reference;
|
| 141 |
+
typedef const value_type& const_reference;
|
| 142 |
typedef implementation-defined size_type;
|
| 143 |
typedef implementation-defined difference_type;
|
| 144 |
|
| 145 |
typedef implementation-defined iterator;
|
| 146 |
typedef implementation-defined const_iterator;
|
| 147 |
typedef implementation-defined local_iterator;
|
| 148 |
typedef implementation-defined const_local_iterator;
|
| 149 |
|
| 150 |
// construct/destroy/copy
|
| 151 |
+
unordered_map();
|
| 152 |
+
explicit unordered_map(size_type n,
|
| 153 |
const hasher& hf = hasher(),
|
| 154 |
const key_equal& eql = key_equal(),
|
| 155 |
const allocator_type& a = allocator_type());
|
| 156 |
template <class InputIterator>
|
| 157 |
unordered_map(InputIterator f, InputIterator l,
|
|
|
|
| 167 |
unordered_map(initializer_list<value_type>,
|
| 168 |
size_type = see below,
|
| 169 |
const hasher& hf = hasher(),
|
| 170 |
const key_equal& eql = key_equal(),
|
| 171 |
const allocator_type& a = allocator_type());
|
| 172 |
+
unordered_map(size_type n, const allocator_type& a)
|
| 173 |
+
: unordered_map(n, hasher(), key_equal(), a) { }
|
| 174 |
+
unordered_map(size_type n, const hasher& hf, const allocator_type& a)
|
| 175 |
+
: unordered_map(n, hf, key_equal(), a) { }
|
| 176 |
+
template <class InputIterator>
|
| 177 |
+
unordered_map(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
|
| 178 |
+
: unordered_map(f, l, n, hasher(), key_equal(), a) { }
|
| 179 |
+
template <class InputIterator>
|
| 180 |
+
unordered_map(InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
| 181 |
+
const allocator_type& a)
|
| 182 |
+
: unordered_map(f, l, n, hf, key_equal(), a) { }
|
| 183 |
+
unordered_map(initializer_list<value_type> il, size_type n, const allocator_type& a)
|
| 184 |
+
: unordered_map(il, n, hasher(), key_equal(), a) { }
|
| 185 |
+
unordered_map(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 186 |
+
const allocator_type& a)
|
| 187 |
+
: unordered_map(il, n, hf, key_equal(), a) { }
|
| 188 |
~unordered_map();
|
| 189 |
unordered_map& operator=(const unordered_map&);
|
| 190 |
unordered_map& operator=(unordered_map&&);
|
| 191 |
unordered_map& operator=(initializer_list<value_type>);
|
| 192 |
allocator_type get_allocator() const noexcept;
|
|
|
|
| 271 |
```
|
| 272 |
|
| 273 |
#### `unordered_map` constructors <a id="unord.map.cnstr">[[unord.map.cnstr]]</a>
|
| 274 |
|
| 275 |
``` cpp
|
| 276 |
+
unordered_map() : unordered_map(size_type(see below)) { }
|
| 277 |
+
explicit unordered_map(size_type n,
|
| 278 |
const hasher& hf = hasher(),
|
| 279 |
const key_equal& eql = key_equal(),
|
| 280 |
const allocator_type& a = allocator_type());
|
| 281 |
```
|
| 282 |
|
| 283 |
*Effects:* Constructs an empty `unordered_map` using the specified hash
|
| 284 |
function, key equality function, and allocator, and using at least *`n`*
|
| 285 |
+
buckets. For the default constructor, the number of buckets is
|
| 286 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 287 |
|
| 288 |
*Complexity:* Constant.
|
| 289 |
|
| 290 |
``` cpp
|
|
|
|
| 309 |
``` cpp
|
| 310 |
mapped_type& operator[](const key_type& k);
|
| 311 |
mapped_type& operator[](key_type&& k);
|
| 312 |
```
|
| 313 |
|
| 314 |
+
*Requires:* `mapped_type` shall be `DefaultInsertable` into `*this`. For
|
| 315 |
+
the first operator, `key_type` shall be `CopyInsertable` into `*this`.
|
| 316 |
+
For the second operator, `key_type` shall be `MoveConstructible`.
|
| 317 |
|
| 318 |
*Effects:* If the `unordered_map` does not already contain an element
|
| 319 |
whose key is equivalent to *`k`*, the first operator inserts the value
|
| 320 |
`value_type(k, mapped_type())` and the second operator inserts the value
|
| 321 |
`value_type(std::move(k), mapped_type())`.
|
|
|
|
| 341 |
``` cpp
|
| 342 |
template <class P>
|
| 343 |
pair<iterator, bool> insert(P&& obj);
|
| 344 |
```
|
| 345 |
|
| 346 |
+
*Effects:* Equivalent to `return emplace(std::forward<P>(obj))`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
|
| 348 |
*Remarks:* This signature shall not participate in overload resolution
|
| 349 |
+
unless `std::is_constructible<value_type, P&&>::value` is `true`.
|
| 350 |
|
| 351 |
``` cpp
|
| 352 |
template <class P>
|
| 353 |
iterator insert(const_iterator hint, P&& obj);
|
| 354 |
```
|
| 355 |
|
| 356 |
+
*Effects:* Equivalent to
|
| 357 |
+
`return emplace_hint(hint, std::forward<P>(obj))`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
|
| 359 |
*Remarks:* This signature shall not participate in overload resolution
|
| 360 |
+
unless `std::is_constructible<value_type, P&&>::value` is `true`.
|
| 361 |
|
| 362 |
#### `unordered_map` swap <a id="unord.map.swap">[[unord.map.swap]]</a>
|
| 363 |
|
| 364 |
``` cpp
|
| 365 |
template <class Key, class T, class Hash, class Pred, class Alloc>
|
|
|
|
| 407 |
typedef std::pair<const Key, T> value_type;
|
| 408 |
typedef T mapped_type;
|
| 409 |
typedef Hash hasher;
|
| 410 |
typedef Pred key_equal;
|
| 411 |
typedef Allocator allocator_type;
|
| 412 |
+
typedef typename allocator_traits<Allocator>::pointer pointer;
|
| 413 |
+
typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
|
| 414 |
+
typedef value_type& reference;
|
| 415 |
+
typedef const value_type& const_reference;
|
| 416 |
typedef implementation-defined size_type;
|
| 417 |
typedef implementation-defined difference_type;
|
| 418 |
|
| 419 |
typedef implementation-defined iterator;
|
| 420 |
typedef implementation-defined const_iterator;
|
| 421 |
typedef implementation-defined local_iterator;
|
| 422 |
typedef implementation-defined const_local_iterator;
|
| 423 |
|
| 424 |
// construct/destroy/copy
|
| 425 |
+
unordered_multimap();
|
| 426 |
+
explicit unordered_multimap(size_type n,
|
| 427 |
const hasher& hf = hasher(),
|
| 428 |
const key_equal& eql = key_equal(),
|
| 429 |
const allocator_type& a = allocator_type());
|
| 430 |
template <class InputIterator>
|
| 431 |
unordered_multimap(InputIterator f, InputIterator l,
|
|
|
|
| 441 |
unordered_multimap(initializer_list<value_type>,
|
| 442 |
size_type = see below,
|
| 443 |
const hasher& hf = hasher(),
|
| 444 |
const key_equal& eql = key_equal(),
|
| 445 |
const allocator_type& a = allocator_type());
|
| 446 |
+
unordered_multimap(size_type n, const allocator_type& a)
|
| 447 |
+
: unordered_multimap(n, hasher(), key_equal(), a) { }
|
| 448 |
+
unordered_multimap(size_type n, const hasher& hf, const allocator_type& a)
|
| 449 |
+
: unordered_multimap(n, hf, key_equal(), a) { }
|
| 450 |
+
template <class InputIterator>
|
| 451 |
+
unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
|
| 452 |
+
: unordered_multimap(f, l, n, hasher(), key_equal(), a) { }
|
| 453 |
+
template <class InputIterator>
|
| 454 |
+
unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
| 455 |
+
const allocator_type& a)
|
| 456 |
+
: unordered_multimap(f, l, n, hf, key_equal(), a) { }
|
| 457 |
+
unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
|
| 458 |
+
: unordered_multimap(il, n, hasher(), key_equal(), a) { }
|
| 459 |
+
unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 460 |
+
const allocator_type& a)
|
| 461 |
+
: unordered_multimap(il, n, hf, key_equal(), a) { }
|
| 462 |
~unordered_multimap();
|
| 463 |
unordered_multimap& operator=(const unordered_multimap&);
|
| 464 |
unordered_multimap& operator=(unordered_multimap&&);
|
| 465 |
unordered_multimap& operator=(initializer_list<value_type>);
|
| 466 |
allocator_type get_allocator() const noexcept;
|
|
|
|
| 540 |
```
|
| 541 |
|
| 542 |
#### `unordered_multimap` constructors <a id="unord.multimap.cnstr">[[unord.multimap.cnstr]]</a>
|
| 543 |
|
| 544 |
``` cpp
|
| 545 |
+
unordered_multimap() : unordered_multimap(size_type(see below)) { }
|
| 546 |
+
explicit unordered_multimap(size_type n,
|
| 547 |
const hasher& hf = hasher(),
|
| 548 |
const key_equal& eql = key_equal(),
|
| 549 |
const allocator_type& a = allocator_type());
|
| 550 |
```
|
| 551 |
|
| 552 |
*Effects:* Constructs an empty `unordered_multimap` using the specified
|
| 553 |
hash function, key equality function, and allocator, and using at least
|
| 554 |
+
*`n`* buckets. For the default constructor, the number of buckets is
|
| 555 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 556 |
|
| 557 |
*Complexity:* Constant.
|
| 558 |
|
| 559 |
``` cpp
|
|
|
|
| 578 |
``` cpp
|
| 579 |
template <class P>
|
| 580 |
iterator insert(P&& obj);
|
| 581 |
```
|
| 582 |
|
| 583 |
+
*Effects:* Equivalent to `return emplace(std::forward<P>(obj))`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 584 |
|
| 585 |
*Remarks:* This signature shall not participate in overload resolution
|
| 586 |
+
unless `std::is_constructible<value_type, P&&>::value` is `true`.
|
| 587 |
|
| 588 |
``` cpp
|
| 589 |
template <class P>
|
| 590 |
iterator insert(const_iterator hint, P&& obj);
|
| 591 |
```
|
| 592 |
|
| 593 |
+
*Effects:* Equivalent to
|
| 594 |
+
`return emplace_hint(hint, std::forward<P>(obj))`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
|
| 596 |
*Remarks:* This signature shall not participate in overload resolution
|
| 597 |
+
unless `std::is_constructible<value_type, P&&>::value` is `true`.
|
| 598 |
|
| 599 |
#### `unordered_multimap` swap <a id="unord.multimap.swap">[[unord.multimap.swap]]</a>
|
| 600 |
|
| 601 |
``` cpp
|
| 602 |
template <class Key, class T, class Hash, class Pred, class Alloc>
|
|
|
|
| 642 |
typedef Key key_type;
|
| 643 |
typedef Key value_type;
|
| 644 |
typedef Hash hasher;
|
| 645 |
typedef Pred key_equal;
|
| 646 |
typedef Allocator allocator_type;
|
| 647 |
+
typedef typename allocator_traits<Allocator>::pointer pointer;
|
| 648 |
+
typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
|
| 649 |
+
typedef value_type& reference;
|
| 650 |
+
typedef const value_type& const_reference;
|
| 651 |
typedef implementation-defined size_type;
|
| 652 |
typedef implementation-defined difference_type;
|
| 653 |
|
| 654 |
typedef implementation-defined iterator;
|
| 655 |
typedef implementation-defined const_iterator;
|
| 656 |
typedef implementation-defined local_iterator;
|
| 657 |
typedef implementation-defined const_local_iterator;
|
| 658 |
|
| 659 |
// construct/destroy/copy
|
| 660 |
+
unordered_set();
|
| 661 |
+
explicit unordered_set(size_type n,
|
| 662 |
const hasher& hf = hasher(),
|
| 663 |
const key_equal& eql = key_equal(),
|
| 664 |
const allocator_type& a = allocator_type());
|
| 665 |
template <class InputIterator>
|
| 666 |
unordered_set(InputIterator f, InputIterator l,
|
|
|
|
| 676 |
unordered_set(initializer_list<value_type>,
|
| 677 |
size_type = see below,
|
| 678 |
const hasher& hf = hasher(),
|
| 679 |
const key_equal& eql = key_equal(),
|
| 680 |
const allocator_type& a = allocator_type());
|
| 681 |
+
unordered_set(size_type n, const allocator_type& a)
|
| 682 |
+
: unordered_set(n, hasher(), key_equal(), a) { }
|
| 683 |
+
unordered_set(size_type n, const hasher& hf, const allocator_type& a)
|
| 684 |
+
: unordered_set(n, hf, key_equal(), a) { }
|
| 685 |
+
template <class InputIterator>
|
| 686 |
+
unordered_set(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
|
| 687 |
+
: unordered_set(f, l, n, hasher(), key_equal(), a) { }
|
| 688 |
+
template <class InputIterator>
|
| 689 |
+
unordered_set(InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
| 690 |
+
const allocator_type& a)
|
| 691 |
+
: unordered_set(f, l, n, hf, key_equal(), a) { }
|
| 692 |
+
unordered_set(initializer_list<value_type> il, size_type n, const allocator_type& a)
|
| 693 |
+
: unordered_set(il, n, hasher(), key_equal(), a) { }
|
| 694 |
+
unordered_set(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 695 |
+
const allocator_type& a)
|
| 696 |
+
: unordered_set(il, n, hf, key_equal(), a) { }
|
| 697 |
~unordered_set();
|
| 698 |
unordered_set& operator=(const unordered_set&);
|
| 699 |
unordered_set& operator=(unordered_set&&);
|
| 700 |
unordered_set& operator=(initializer_list<value_type>);
|
| 701 |
allocator_type get_allocator() const noexcept;
|
|
|
|
| 763 |
|
| 764 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 765 |
void swap(unordered_set<Key, Hash, Pred, Alloc>& x,
|
| 766 |
unordered_set<Key, Hash, Pred, Alloc>& y);
|
| 767 |
|
| 768 |
+
template <class Key, class Hash, class Pred, class Alloc>
|
| 769 |
+
bool operator==(const unordered_set<Key, Hash, Pred, Alloc>& a,
|
| 770 |
+
const unordered_set<Key, Hash, Pred, Alloc>& b);
|
| 771 |
+
template <class Key, class Hash, class Pred, class Alloc>
|
| 772 |
+
bool operator!=(const unordered_set<Key, Hash, Pred, Alloc>& a,
|
| 773 |
+
const unordered_set<Key, Hash, Pred, Alloc>& b);
|
| 774 |
}
|
| 775 |
```
|
| 776 |
|
| 777 |
#### `unordered_set` constructors <a id="unord.set.cnstr">[[unord.set.cnstr]]</a>
|
| 778 |
|
| 779 |
``` cpp
|
| 780 |
+
unordered_set() : unordered_set(size_type(see below)) { }
|
| 781 |
+
explicit unordered_set(size_type n,
|
| 782 |
const hasher& hf = hasher(),
|
| 783 |
const key_equal& eql = key_equal(),
|
| 784 |
const allocator_type& a = allocator_type());
|
| 785 |
```
|
| 786 |
|
| 787 |
*Effects:* Constructs an empty `unordered_set` using the specified hash
|
| 788 |
function, key equality function, and allocator, and using at least *`n`*
|
| 789 |
+
buckets. For the default constructor, the number of buckets is
|
| 790 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 791 |
|
| 792 |
*Complexity:* Constant.
|
| 793 |
|
| 794 |
``` cpp
|
|
|
|
| 855 |
typedef Key key_type;
|
| 856 |
typedef Key value_type;
|
| 857 |
typedef Hash hasher;
|
| 858 |
typedef Pred key_equal;
|
| 859 |
typedef Allocator allocator_type;
|
| 860 |
+
typedef typename allocator_traits<Allocator>::pointer pointer;
|
| 861 |
+
typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
|
| 862 |
+
typedef value_type& reference;
|
| 863 |
+
typedef const value_type& const_reference;
|
| 864 |
typedef implementation-defined size_type;
|
| 865 |
typedef implementation-defined difference_type;
|
| 866 |
|
| 867 |
typedef implementation-defined iterator;
|
| 868 |
typedef implementation-defined const_iterator;
|
| 869 |
typedef implementation-defined local_iterator;
|
| 870 |
typedef implementation-defined const_local_iterator;
|
| 871 |
|
| 872 |
// construct/destroy/copy
|
| 873 |
+
unordered_multiset();
|
| 874 |
+
explicit unordered_multiset(size_type n,
|
| 875 |
const hasher& hf = hasher(),
|
| 876 |
const key_equal& eql = key_equal(),
|
| 877 |
const allocator_type& a = allocator_type());
|
| 878 |
template <class InputIterator>
|
| 879 |
unordered_multiset(InputIterator f, InputIterator l,
|
|
|
|
| 889 |
unordered_multiset(initializer_list<value_type>,
|
| 890 |
size_type = see below,
|
| 891 |
const hasher& hf = hasher(),
|
| 892 |
const key_equal& eql = key_equal(),
|
| 893 |
const allocator_type& a = allocator_type());
|
| 894 |
+
unordered_multiset(size_type n, const allocator_type& a)
|
| 895 |
+
: unordered_multiset(n, hasher(), key_equal(), a) { }
|
| 896 |
+
unordered_multiset(size_type n, const hasher& hf, const allocator_type& a)
|
| 897 |
+
: unordered_multiset(n, hf, key_equal(), a) { }
|
| 898 |
+
template <class InputIterator>
|
| 899 |
+
unordered_multiset(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
|
| 900 |
+
: unordered_multiset(f, l, n, hasher(), key_equal(), a) { }
|
| 901 |
+
template <class InputIterator>
|
| 902 |
+
unordered_multiset(InputIterator f, InputIterator l, size_type n, const hasher& hf,
|
| 903 |
+
const allocator_type& a)
|
| 904 |
+
: unordered_multiset(f, l, n, hf, key_equal(), a) { }
|
| 905 |
+
unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a)
|
| 906 |
+
: unordered_multiset(il, n, hasher(), key_equal(), a) { }
|
| 907 |
+
unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 908 |
+
const allocator_type& a)
|
| 909 |
+
: unordered_multiset(il, n, hf, key_equal(), a) { }
|
| 910 |
~unordered_multiset();
|
| 911 |
unordered_multiset& operator=(const unordered_multiset&);
|
| 912 |
+
unordered_multiset& operator=(unordered_multiset&&);
|
| 913 |
unordered_multiset& operator=(initializer_list<value_type>);
|
| 914 |
allocator_type get_allocator() const noexcept;
|
| 915 |
|
| 916 |
// size and capacity
|
| 917 |
bool empty() const noexcept;
|
|
|
|
| 975 |
};
|
| 976 |
|
| 977 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 978 |
void swap(unordered_multiset<Key, Hash, Pred, Alloc>& x,
|
| 979 |
unordered_multiset<Key, Hash, Pred, Alloc>& y);
|
| 980 |
+
template <class Key, class Hash, class Pred, class Alloc>
|
| 981 |
+
bool operator==(const unordered_multiset<Key, Hash, Pred, Alloc>& a,
|
| 982 |
+
const unordered_multiset<Key, Hash, Pred, Alloc>& b);
|
| 983 |
+
template <class Key, class Hash, class Pred, class Alloc>
|
| 984 |
+
bool operator!=(const unordered_multiset<Key, Hash, Pred, Alloc>& a,
|
| 985 |
+
const unordered_multiset<Key, Hash, Pred, Alloc>& b);
|
| 986 |
}
|
| 987 |
```
|
| 988 |
|
| 989 |
#### `unordered_multiset` constructors <a id="unord.multiset.cnstr">[[unord.multiset.cnstr]]</a>
|
| 990 |
|
| 991 |
``` cpp
|
| 992 |
+
unordered_multiset() : unordered_multiset(size_type(see below)) { }
|
| 993 |
+
explicit unordered_multiset(size_type n,
|
| 994 |
const hasher& hf = hasher(),
|
| 995 |
const key_equal& eql = key_equal(),
|
| 996 |
const allocator_type& a = allocator_type());
|
| 997 |
```
|
| 998 |
|
| 999 |
*Effects:* Constructs an empty `unordered_multiset` using the specified
|
| 1000 |
hash function, key equality function, and allocator, and using at least
|
| 1001 |
+
*`n`* buckets. For the default constructor, the number of buckets is
|
| 1002 |
*implementation-defined*. `max_load_factor()` returns 1.0.
|
| 1003 |
|
| 1004 |
*Complexity:* Constant.
|
| 1005 |
|
| 1006 |
``` cpp
|