- tmp/tmpjq_1hjs4/{from.md → to.md} +107 -43
tmp/tmpjq_1hjs4/{from.md → to.md}
RENAMED
|
@@ -11,45 +11,45 @@ container, of an unordered associative container, and of an
|
|
| 11 |
allocator-aware container (Table [[tab:containers.allocatoraware]]). It
|
| 12 |
provides the operations described in the preceding requirements table
|
| 13 |
for equivalent keys; that is, an `unordered_multiset` supports the
|
| 14 |
`a_eq` operations in that table, not the `a_uniq` operations. For an
|
| 15 |
`unordered_multiset<Key>` the `key type` and the value type are both
|
| 16 |
-
`Key`. The `iterator` and `const_iterator` types are both
|
| 17 |
-
types. It is unspecified whether they are the same type.
|
| 18 |
|
| 19 |
This section only describes operations on `unordered_multiset` that are
|
| 20 |
not described in one of the requirement tables, or for which there is
|
| 21 |
additional semantic information.
|
| 22 |
|
| 23 |
``` cpp
|
| 24 |
namespace std {
|
| 25 |
template <class Key,
|
| 26 |
class Hash = hash<Key>,
|
| 27 |
-
class Pred
|
| 28 |
-
class Allocator =
|
| 29 |
-
class unordered_multiset
|
| 30 |
-
{
|
| 31 |
public:
|
| 32 |
-
// types
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
| 49 |
|
| 50 |
-
// construct/
|
| 51 |
unordered_multiset();
|
| 52 |
explicit unordered_multiset(size_type n,
|
| 53 |
const hasher& hf = hasher(),
|
| 54 |
const key_equal& eql = key_equal(),
|
| 55 |
const allocator_type& a = allocator_type());
|
|
@@ -62,12 +62,12 @@ namespace std {
|
|
| 62 |
unordered_multiset(const unordered_multiset&);
|
| 63 |
unordered_multiset(unordered_multiset&&);
|
| 64 |
explicit unordered_multiset(const Allocator&);
|
| 65 |
unordered_multiset(const unordered_multiset&, const Allocator&);
|
| 66 |
unordered_multiset(unordered_multiset&&, const Allocator&);
|
| 67 |
-
unordered_multiset(initializer_list<value_type>,
|
| 68 |
-
|
| 69 |
const hasher& hf = hasher(),
|
| 70 |
const key_equal& eql = key_equal(),
|
| 71 |
const allocator_type& a = allocator_type());
|
| 72 |
unordered_multiset(size_type n, const allocator_type& a)
|
| 73 |
: unordered_multiset(n, hasher(), key_equal(), a) { }
|
|
@@ -85,56 +85,76 @@ namespace std {
|
|
| 85 |
unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 86 |
const allocator_type& a)
|
| 87 |
: unordered_multiset(il, n, hf, key_equal(), a) { }
|
| 88 |
~unordered_multiset();
|
| 89 |
unordered_multiset& operator=(const unordered_multiset&);
|
| 90 |
-
unordered_multiset& operator=(unordered_multiset&&)
|
|
|
|
|
|
|
|
|
|
| 91 |
unordered_multiset& operator=(initializer_list<value_type>);
|
| 92 |
allocator_type get_allocator() const noexcept;
|
| 93 |
|
| 94 |
-
//
|
| 95 |
-
bool empty() const noexcept;
|
| 96 |
-
size_type size() const noexcept;
|
| 97 |
-
size_type max_size() const noexcept;
|
| 98 |
-
|
| 99 |
-
// iterators
|
| 100 |
iterator begin() noexcept;
|
| 101 |
const_iterator begin() const noexcept;
|
| 102 |
iterator end() noexcept;
|
| 103 |
const_iterator end() const noexcept;
|
| 104 |
const_iterator cbegin() const noexcept;
|
| 105 |
const_iterator cend() const noexcept;
|
| 106 |
|
| 107 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
template <class... Args> iterator emplace(Args&&... args);
|
| 109 |
template <class... Args> iterator emplace_hint(const_iterator position, Args&&... args);
|
| 110 |
iterator insert(const value_type& obj);
|
| 111 |
iterator insert(value_type&& obj);
|
| 112 |
iterator insert(const_iterator hint, const value_type& obj);
|
| 113 |
iterator insert(const_iterator hint, value_type&& obj);
|
| 114 |
template <class InputIterator> void insert(InputIterator first, InputIterator last);
|
| 115 |
void insert(initializer_list<value_type>);
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
iterator erase(const_iterator position);
|
| 118 |
size_type erase(const key_type& k);
|
| 119 |
iterator erase(const_iterator first, const_iterator last);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
void clear() noexcept;
|
| 121 |
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
-
// observers
|
| 125 |
hasher hash_function() const;
|
| 126 |
key_equal key_eq() const;
|
| 127 |
|
| 128 |
-
//
|
| 129 |
iterator find(const key_type& k);
|
| 130 |
const_iterator find(const key_type& k) const;
|
| 131 |
size_type count(const key_type& k) const;
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
-
// bucket interface
|
| 136 |
size_type bucket_count() const noexcept;
|
| 137 |
size_type max_bucket_count() const noexcept;
|
| 138 |
size_type bucket_size(size_type n) const;
|
| 139 |
size_type bucket(const key_type& k) const;
|
| 140 |
local_iterator begin(size_type n);
|
|
@@ -142,25 +162,69 @@ namespace std {
|
|
| 142 |
local_iterator end(size_type n);
|
| 143 |
const_local_iterator end(size_type n) const;
|
| 144 |
const_local_iterator cbegin(size_type n) const;
|
| 145 |
const_local_iterator cend(size_type n) const;
|
| 146 |
|
| 147 |
-
// hash policy
|
| 148 |
float load_factor() const noexcept;
|
| 149 |
float max_load_factor() const noexcept;
|
| 150 |
void max_load_factor(float z);
|
| 151 |
void rehash(size_type n);
|
| 152 |
void reserve(size_type n);
|
| 153 |
};
|
| 154 |
|
| 155 |
-
template
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 159 |
bool operator==(const unordered_multiset<Key, Hash, Pred, Alloc>& a,
|
| 160 |
const unordered_multiset<Key, Hash, Pred, Alloc>& b);
|
| 161 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 162 |
bool operator!=(const unordered_multiset<Key, Hash, Pred, Alloc>& a,
|
| 163 |
const unordered_multiset<Key, Hash, Pred, Alloc>& b);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
}
|
| 165 |
```
|
| 166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
allocator-aware container (Table [[tab:containers.allocatoraware]]). It
|
| 12 |
provides the operations described in the preceding requirements table
|
| 13 |
for equivalent keys; that is, an `unordered_multiset` supports the
|
| 14 |
`a_eq` operations in that table, not the `a_uniq` operations. For an
|
| 15 |
`unordered_multiset<Key>` the `key type` and the value type are both
|
| 16 |
+
`Key`. The `iterator` and `const_iterator` types are both constant
|
| 17 |
+
iterator types. It is unspecified whether they are the same type.
|
| 18 |
|
| 19 |
This section only describes operations on `unordered_multiset` that are
|
| 20 |
not described in one of the requirement tables, or for which there is
|
| 21 |
additional semantic information.
|
| 22 |
|
| 23 |
``` cpp
|
| 24 |
namespace std {
|
| 25 |
template <class Key,
|
| 26 |
class Hash = hash<Key>,
|
| 27 |
+
class Pred = equal_to<Key>,
|
| 28 |
+
class Allocator = allocator<Key>>
|
| 29 |
+
class unordered_multiset {
|
|
|
|
| 30 |
public:
|
| 31 |
+
// types:
|
| 32 |
+
using key_type = Key;
|
| 33 |
+
using value_type = Key;
|
| 34 |
+
using hasher = Hash;
|
| 35 |
+
using key_equal = Pred;
|
| 36 |
+
using allocator_type = Allocator;
|
| 37 |
+
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 38 |
+
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 39 |
+
using reference = value_type&;
|
| 40 |
+
using const_reference = const value_type&;
|
| 41 |
+
using size_type = implementation-defined; // see [container.requirements]
|
| 42 |
+
using difference_type = implementation-defined; // see [container.requirements]
|
| 43 |
|
| 44 |
+
using iterator = implementation-defined // type of unordered_multiset::iterator; // see [container.requirements]
|
| 45 |
+
using const_iterator = implementation-defined // type of unordered_multiset::const_iterator; // see [container.requirements]
|
| 46 |
+
using local_iterator = implementation-defined // type of unordered_multiset::local_iterator; // see [container.requirements]
|
| 47 |
+
using const_local_iterator = implementation-defined // type of unordered_multiset::const_local_iterator; // see [container.requirements]
|
| 48 |
+
using node_type = unspecified;
|
| 49 |
|
| 50 |
+
// [unord.multiset.cnstr], construct/copy/destroy
|
| 51 |
unordered_multiset();
|
| 52 |
explicit unordered_multiset(size_type n,
|
| 53 |
const hasher& hf = hasher(),
|
| 54 |
const key_equal& eql = key_equal(),
|
| 55 |
const allocator_type& a = allocator_type());
|
|
|
|
| 62 |
unordered_multiset(const unordered_multiset&);
|
| 63 |
unordered_multiset(unordered_multiset&&);
|
| 64 |
explicit unordered_multiset(const Allocator&);
|
| 65 |
unordered_multiset(const unordered_multiset&, const Allocator&);
|
| 66 |
unordered_multiset(unordered_multiset&&, const Allocator&);
|
| 67 |
+
unordered_multiset(initializer_list<value_type> il,
|
| 68 |
+
size_type n = see below,
|
| 69 |
const hasher& hf = hasher(),
|
| 70 |
const key_equal& eql = key_equal(),
|
| 71 |
const allocator_type& a = allocator_type());
|
| 72 |
unordered_multiset(size_type n, const allocator_type& a)
|
| 73 |
: unordered_multiset(n, hasher(), key_equal(), a) { }
|
|
|
|
| 85 |
unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
|
| 86 |
const allocator_type& a)
|
| 87 |
: unordered_multiset(il, n, hf, key_equal(), a) { }
|
| 88 |
~unordered_multiset();
|
| 89 |
unordered_multiset& operator=(const unordered_multiset&);
|
| 90 |
+
unordered_multiset& operator=(unordered_multiset&&)
|
| 91 |
+
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 92 |
+
is_nothrow_move_assignable_v<Hash> &&
|
| 93 |
+
is_nothrow_move_assignable_v<Pred>);
|
| 94 |
unordered_multiset& operator=(initializer_list<value_type>);
|
| 95 |
allocator_type get_allocator() const noexcept;
|
| 96 |
|
| 97 |
+
// iterators:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
iterator begin() noexcept;
|
| 99 |
const_iterator begin() const noexcept;
|
| 100 |
iterator end() noexcept;
|
| 101 |
const_iterator end() const noexcept;
|
| 102 |
const_iterator cbegin() const noexcept;
|
| 103 |
const_iterator cend() const noexcept;
|
| 104 |
|
| 105 |
+
// capacity:
|
| 106 |
+
bool empty() const noexcept;
|
| 107 |
+
size_type size() const noexcept;
|
| 108 |
+
size_type max_size() const noexcept;
|
| 109 |
+
|
| 110 |
+
// modifiers:
|
| 111 |
template <class... Args> iterator emplace(Args&&... args);
|
| 112 |
template <class... Args> iterator emplace_hint(const_iterator position, Args&&... args);
|
| 113 |
iterator insert(const value_type& obj);
|
| 114 |
iterator insert(value_type&& obj);
|
| 115 |
iterator insert(const_iterator hint, const value_type& obj);
|
| 116 |
iterator insert(const_iterator hint, value_type&& obj);
|
| 117 |
template <class InputIterator> void insert(InputIterator first, InputIterator last);
|
| 118 |
void insert(initializer_list<value_type>);
|
| 119 |
|
| 120 |
+
node_type extract(const_iterator position);
|
| 121 |
+
node_type extract(const key_type& x);
|
| 122 |
+
iterator insert(node_type&& nh);
|
| 123 |
+
iterator insert(const_iterator hint, node_type&& nh);
|
| 124 |
+
|
| 125 |
+
iterator erase(iterator position);
|
| 126 |
iterator erase(const_iterator position);
|
| 127 |
size_type erase(const key_type& k);
|
| 128 |
iterator erase(const_iterator first, const_iterator last);
|
| 129 |
+
void swap(unordered_multiset&)
|
| 130 |
+
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 131 |
+
is_nothrow_swappable_v<Hash> &&
|
| 132 |
+
is_nothrow_swappable_v<Pred>);
|
| 133 |
void clear() noexcept;
|
| 134 |
|
| 135 |
+
template<class H2, class P2>
|
| 136 |
+
void merge(unordered_multiset<Key, H2, P2, Allocator>& source);
|
| 137 |
+
template<class H2, class P2>
|
| 138 |
+
void merge(unordered_multiset<Key, H2, P2, Allocator>&& source);
|
| 139 |
+
template<class H2, class P2>
|
| 140 |
+
void merge(unordered_set<Key, H2, P2, Allocator>& source);
|
| 141 |
+
template<class H2, class P2>
|
| 142 |
+
void merge(unordered_set<Key, H2, P2, Allocator>&& source);
|
| 143 |
|
| 144 |
+
// observers:
|
| 145 |
hasher hash_function() const;
|
| 146 |
key_equal key_eq() const;
|
| 147 |
|
| 148 |
+
// set operations:
|
| 149 |
iterator find(const key_type& k);
|
| 150 |
const_iterator find(const key_type& k) const;
|
| 151 |
size_type count(const key_type& k) const;
|
| 152 |
+
pair<iterator, iterator> equal_range(const key_type& k);
|
| 153 |
+
pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
|
| 154 |
|
| 155 |
+
// bucket interface:
|
| 156 |
size_type bucket_count() const noexcept;
|
| 157 |
size_type max_bucket_count() const noexcept;
|
| 158 |
size_type bucket_size(size_type n) const;
|
| 159 |
size_type bucket(const key_type& k) const;
|
| 160 |
local_iterator begin(size_type n);
|
|
|
|
| 162 |
local_iterator end(size_type n);
|
| 163 |
const_local_iterator end(size_type n) const;
|
| 164 |
const_local_iterator cbegin(size_type n) const;
|
| 165 |
const_local_iterator cend(size_type n) const;
|
| 166 |
|
| 167 |
+
// hash policy:
|
| 168 |
float load_factor() const noexcept;
|
| 169 |
float max_load_factor() const noexcept;
|
| 170 |
void max_load_factor(float z);
|
| 171 |
void rehash(size_type n);
|
| 172 |
void reserve(size_type n);
|
| 173 |
};
|
| 174 |
|
| 175 |
+
template<class InputIterator,
|
| 176 |
+
class Hash = hash<typename iterator_traits<InputIterator>::value_type>,
|
| 177 |
+
class Pred = equal_to<typename iterator_traits<InputIterator>::value_type>,
|
| 178 |
+
class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
|
| 179 |
+
unordered_multiset(InputIterator, InputIterator, see below::size_type = see below,
|
| 180 |
+
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
| 181 |
+
-> unordered_multiset<typename iterator_traits<InputIterator>::value_type,
|
| 182 |
+
Hash, Pred, Allocator>;
|
| 183 |
+
|
| 184 |
+
template<class T, class Hash = hash<T>,
|
| 185 |
+
class Pred = equal_to<T>, class Allocator = allocator<T>>
|
| 186 |
+
unordered_multiset(initializer_list<T>, typename see below::size_type = see below,
|
| 187 |
+
Hash = Hash(), Pred = Pred(), Allocator = Allocator())
|
| 188 |
+
-> unordered_multiset<T, Hash, Pred, Allocator>;
|
| 189 |
+
|
| 190 |
+
template<class InputIterator, class Allocator>
|
| 191 |
+
unordered_multiset(InputIterator, InputIterator, typename see below::size_type, Allocator)
|
| 192 |
+
-> unordered_multiset<typename iterator_traits<InputIterator>::value_type,
|
| 193 |
+
hash<typename iterator_traits<InputIterator>::value_type>,
|
| 194 |
+
equal_to<typename iterator_traits<InputIterator>::value_type>,
|
| 195 |
+
Allocator>;
|
| 196 |
+
|
| 197 |
+
template<class InputIterator, class Hash, class Allocator>
|
| 198 |
+
unordered_multiset(InputIterator, InputIterator, typename see below::size_type,
|
| 199 |
+
Hash, Allocator)
|
| 200 |
+
-> unordered_multiset<typename iterator_traits<InputIterator>::value_type, Hash,
|
| 201 |
+
equal_to<typename iterator_traits<InputIterator>::value_type>,
|
| 202 |
+
Allocator>;
|
| 203 |
+
|
| 204 |
+
template<class T, class Allocator>
|
| 205 |
+
unordered_multiset(initializer_list<T>, typename see below::size_type, Allocator)
|
| 206 |
+
-> unordered_multiset<T, hash<T>, equal_to<T>, Allocator>;
|
| 207 |
+
|
| 208 |
+
template<class T, class Hash, class Allocator>
|
| 209 |
+
unordered_multiset(initializer_list<T>, typename see below::size_type, Hash, Allocator)
|
| 210 |
+
-> unordered_multiset<T, Hash, equal_to<T>, Allocator>;
|
| 211 |
+
|
| 212 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 213 |
bool operator==(const unordered_multiset<Key, Hash, Pred, Alloc>& a,
|
| 214 |
const unordered_multiset<Key, Hash, Pred, Alloc>& b);
|
| 215 |
template <class Key, class Hash, class Pred, class Alloc>
|
| 216 |
bool operator!=(const unordered_multiset<Key, Hash, Pred, Alloc>& a,
|
| 217 |
const unordered_multiset<Key, Hash, Pred, Alloc>& b);
|
| 218 |
+
|
| 219 |
+
// [unord.multiset.swap], swap
|
| 220 |
+
template <class Key, class Hash, class Pred, class Alloc>
|
| 221 |
+
void swap(unordered_multiset<Key, Hash, Pred, Alloc>& x,
|
| 222 |
+
unordered_multiset<Key, Hash, Pred, Alloc>& y)
|
| 223 |
+
noexcept(noexcept(x.swap(y)));
|
| 224 |
}
|
| 225 |
```
|
| 226 |
|
| 227 |
+
A `size_type` parameter type in an `unordered_multiset` deduction guide
|
| 228 |
+
refers to the `size_type` member type of the primary
|
| 229 |
+
`unordered_multiset` template.
|
| 230 |
+
|