From Jason Turner

[unord.multiset]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptj4fc9yc/{from.md → to.md} +64 -22
tmp/tmptj4fc9yc/{from.md → to.md} RENAMED
@@ -6,19 +6,20 @@ An `unordered_multiset` is an unordered associative container that
6
  supports equivalent keys (an instance of `unordered_multiset` may
7
  contain multiple copies of the same key value) and in which each
8
  element’s key is the element itself. The `unordered_multiset` class
9
  supports forward iterators.
10
 
11
- An `unordered_multiset` meets all of the requirements of a container, of
12
- an unordered associative container, and of an allocator-aware container
13
- ([[container.alloc.req]]). It provides the operations described in the
14
- preceding requirements table for equivalent keys; that is, an
15
- `unordered_multiset` supports the `a_eq` operations in that table, not
16
- the `a_uniq` operations. For an `unordered_multiset<Key>` the `key type`
17
- and the value type are both `Key`. The `iterator` and `const_iterator`
18
- types are both constant iterator types. It is unspecified whether they
19
- are the same type.
 
20
 
21
  Subclause  [[unord.multiset]] only describes operations on
22
  `unordered_multiset` that are not described in one of the requirement
23
  tables, or for which there is additional semantic information.
24
 
@@ -38,12 +39,12 @@ namespace std {
38
  using allocator_type = Allocator;
39
  using pointer = typename allocator_traits<Allocator>::pointer;
40
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
41
  using reference = value_type&;
42
  using const_reference = const value_type&;
43
- using size_type = implementation-defined; // see [container.requirements]
44
- using difference_type = implementation-defined; // see [container.requirements]
45
 
46
  using iterator = implementation-defined // type of unordered_multiset::iterator; // see [container.requirements]
47
  using const_iterator = implementation-defined // type of unordered_multiset::const_iterator; // see [container.requirements]
48
  using local_iterator = implementation-defined // type of unordered_multiset::local_iterator; // see [container.requirements]
49
  using const_local_iterator = implementation-defined // type of unordered_multiset::const_local_iterator; // see [container.requirements]
@@ -59,15 +60,21 @@ namespace std {
59
  unordered_multiset(InputIterator f, InputIterator l,
60
  size_type n = see below,
61
  const hasher& hf = hasher(),
62
  const key_equal& eql = key_equal(),
63
  const allocator_type& a = allocator_type());
 
 
 
 
 
 
64
  unordered_multiset(const unordered_multiset&);
65
  unordered_multiset(unordered_multiset&&);
66
  explicit unordered_multiset(const Allocator&);
67
- unordered_multiset(const unordered_multiset&, const Allocator&);
68
- unordered_multiset(unordered_multiset&&, const Allocator&);
69
  unordered_multiset(initializer_list<value_type> il,
70
  size_type n = see below,
71
  const hasher& hf = hasher(),
72
  const key_equal& eql = key_equal(),
73
  const allocator_type& a = allocator_type());
@@ -80,10 +87,18 @@ namespace std {
80
  : unordered_multiset(f, l, n, hasher(), key_equal(), a) { }
81
  template<class InputIterator>
82
  unordered_multiset(InputIterator f, InputIterator l, size_type n, const hasher& hf,
83
  const allocator_type& a)
84
  : unordered_multiset(f, l, n, hf, key_equal(), a) { }
 
 
 
 
 
 
 
 
85
  unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a)
86
  : unordered_multiset(il, n, hasher(), key_equal(), a) { }
87
  unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
88
  const allocator_type& a)
89
  : unordered_multiset(il, n, hf, key_equal(), a) { }
@@ -115,20 +130,25 @@ namespace std {
115
  iterator insert(const value_type& obj);
116
  iterator insert(value_type&& obj);
117
  iterator insert(const_iterator hint, const value_type& obj);
118
  iterator insert(const_iterator hint, value_type&& obj);
119
  template<class InputIterator> void insert(InputIterator first, InputIterator last);
 
 
120
  void insert(initializer_list<value_type>);
121
 
122
  node_type extract(const_iterator position);
123
  node_type extract(const key_type& x);
 
124
  iterator insert(node_type&& nh);
125
  iterator insert(const_iterator hint, node_type&& nh);
126
 
127
- iterator erase(iterator position);
 
128
  iterator erase(const_iterator position);
129
  size_type erase(const key_type& k);
 
130
  iterator erase(const_iterator first, const_iterator last);
131
  void swap(unordered_multiset&)
132
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
133
  is_nothrow_swappable_v<Hash> &&
134
  is_nothrow_swappable_v<Pred>);
@@ -194,10 +214,18 @@ namespace std {
194
  unordered_multiset(InputIterator, InputIterator, see below::size_type = see below,
195
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
196
  -> unordered_multiset<iter-value-type<InputIterator>,
197
  Hash, Pred, Allocator>;
198
 
 
 
 
 
 
 
 
 
199
  template<class T, class Hash = hash<T>,
200
  class Pred = equal_to<T>, class Allocator = allocator<T>>
201
  unordered_multiset(initializer_list<T>, typename see below::size_type = see below,
202
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
203
  -> unordered_multiset<T, Hash, Pred, Allocator>;
@@ -214,23 +242,32 @@ namespace std {
214
  Hash, Allocator)
215
  -> unordered_multiset<iter-value-type<InputIterator>, Hash,
216
  equal_to<iter-value-type<InputIterator>>,
217
  Allocator>;
218
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  template<class T, class Allocator>
220
  unordered_multiset(initializer_list<T>, typename see below::size_type, Allocator)
221
  -> unordered_multiset<T, hash<T>, equal_to<T>, Allocator>;
222
 
223
  template<class T, class Hash, class Allocator>
224
  unordered_multiset(initializer_list<T>, typename see below::size_type, Hash, Allocator)
225
  -> unordered_multiset<T, Hash, equal_to<T>, Allocator>;
226
-
227
- // swap
228
- template<class Key, class Hash, class Pred, class Alloc>
229
- void swap(unordered_multiset<Key, Hash, Pred, Alloc>& x,
230
- unordered_multiset<Key, Hash, Pred, Alloc>& y)
231
- noexcept(noexcept(x.swap(y)));
232
  }
233
  ```
234
 
235
  A `size_type` parameter type in an `unordered_multiset` deduction guide
236
  refers to the `size_type` member type of the type deduced by the
@@ -258,10 +295,16 @@ template<class InputIterator>
258
  unordered_multiset(InputIterator f, InputIterator l,
259
  size_type n = see below,
260
  const hasher& hf = hasher(),
261
  const key_equal& eql = key_equal(),
262
  const allocator_type& a = allocator_type());
 
 
 
 
 
 
263
  unordered_multiset(initializer_list<value_type> il,
264
  size_type n = see below,
265
  const hasher& hf = hasher(),
266
  const key_equal& eql = key_equal(),
267
  const allocator_type& a = allocator_type());
@@ -269,12 +312,11 @@ unordered_multiset(initializer_list<value_type> il,
269
 
270
  *Effects:* Constructs an empty `unordered_multiset` using the specified
271
  hash function, key equality predicate, and allocator, and using at least
272
  `n` buckets. If `n` is not provided, the number of buckets is
273
  *implementation-defined*. Then inserts elements from the range \[`f`,
274
- `l`) for the first form, or from the range \[`il.begin()`, `il.end()`)
275
- for the second form. `max_load_factor()` returns `1.0`.
276
 
277
  *Complexity:* Average case linear, worst case quadratic.
278
 
279
  #### Erasure <a id="unord.multiset.erasure">[[unord.multiset.erasure]]</a>
280
 
 
6
  supports equivalent keys (an instance of `unordered_multiset` may
7
  contain multiple copies of the same key value) and in which each
8
  element’s key is the element itself. The `unordered_multiset` class
9
  supports forward iterators.
10
 
11
+ An `unordered_multiset` 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_multiset`
16
+ supports the `a_eq` operations in that table, not the `a_uniq`
17
+ operations. For an `unordered_multiset<Key>` the `key_type` and the
18
+ `value_type` are both `Key`. The `iterator` and `const_iterator` types
19
+ are both constant iterator types. It is unspecified whether they are the
20
+ same type.
21
 
22
  Subclause  [[unord.multiset]] only describes operations on
23
  `unordered_multiset` that are not described in one of the requirement
24
  tables, or for which there is additional semantic information.
25
 
 
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_multiset::size_type; // see [container.requirements]
45
+ using difference_type = implementation-defined // type of unordered_multiset::difference_type; // see [container.requirements]
46
 
47
  using iterator = implementation-defined // type of unordered_multiset::iterator; // see [container.requirements]
48
  using const_iterator = implementation-defined // type of unordered_multiset::const_iterator; // see [container.requirements]
49
  using local_iterator = implementation-defined // type of unordered_multiset::local_iterator; // see [container.requirements]
50
  using const_local_iterator = implementation-defined // type of unordered_multiset::const_local_iterator; // see [container.requirements]
 
60
  unordered_multiset(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_multiset(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_multiset(const unordered_multiset&);
72
  unordered_multiset(unordered_multiset&&);
73
  explicit unordered_multiset(const Allocator&);
74
+ unordered_multiset(const unordered_multiset&, const type_identity_t<Allocator>&);
75
+ unordered_multiset(unordered_multiset&&, const type_identity_t<Allocator>&);
76
  unordered_multiset(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_multiset(f, l, n, hasher(), key_equal(), a) { }
88
  template<class InputIterator>
89
  unordered_multiset(InputIterator f, InputIterator l, size_type n, const hasher& hf,
90
  const allocator_type& a)
91
  : unordered_multiset(f, l, n, hf, key_equal(), a) { }
92
+ template<container-compatible-range<value_type> R>
93
+ unordered_multiset(from_range_t, R&& rg, size_type n, const allocator_type& a)
94
+ : unordered_multiset(from_range, std::forward<R>(rg),
95
+ n, hasher(), key_equal(), a) { }
96
+ template<container-compatible-range<value_type> R>
97
+ unordered_multiset(from_range_t, R&& rg, size_type n, const hasher& hf,
98
+ const allocator_type& a)
99
+ : unordered_multiset(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { }
100
  unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a)
101
  : unordered_multiset(il, n, hasher(), key_equal(), a) { }
102
  unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
103
  const allocator_type& a)
104
  : unordered_multiset(il, n, hf, key_equal(), a) { }
 
130
  iterator insert(const value_type& obj);
131
  iterator insert(value_type&& obj);
132
  iterator insert(const_iterator hint, const value_type& obj);
133
  iterator insert(const_iterator hint, value_type&& obj);
134
  template<class InputIterator> void insert(InputIterator first, InputIterator last);
135
+ template<container-compatible-range<value_type> R>
136
+ void insert_range(R&& rg);
137
  void insert(initializer_list<value_type>);
138
 
139
  node_type extract(const_iterator position);
140
  node_type extract(const key_type& x);
141
+ template<class K> node_type extract(K&& x);
142
  iterator insert(node_type&& nh);
143
  iterator insert(const_iterator hint, node_type&& nh);
144
 
145
+ iterator erase(iterator position)
146
+ requires (!same_as<iterator, const_iterator>);
147
  iterator erase(const_iterator position);
148
  size_type erase(const key_type& k);
149
+ template<class K> size_type erase(K&& x);
150
  iterator erase(const_iterator first, const_iterator last);
151
  void swap(unordered_multiset&)
152
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
153
  is_nothrow_swappable_v<Hash> &&
154
  is_nothrow_swappable_v<Pred>);
 
214
  unordered_multiset(InputIterator, InputIterator, see below::size_type = see below,
215
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
216
  -> unordered_multiset<iter-value-type<InputIterator>,
217
  Hash, Pred, Allocator>;
218
 
219
+ template<ranges::input_range R,
220
+ class Hash = hash<ranges::range_value_t<R>>,
221
+ class Pred = equal_to<ranges::range_value_t<R>>,
222
+ class Allocator = allocator<ranges::range_value_t<R>>>
223
+ unordered_multiset(from_range_t, R&&, typename see below::size_type = see below,
224
+ Hash = Hash(), Pred = Pred(), Allocator = Allocator())
225
+ -> unordered_multiset<ranges::range_value_t<R>, Hash, Pred, Allocator>;
226
+
227
  template<class T, class Hash = hash<T>,
228
  class Pred = equal_to<T>, class Allocator = allocator<T>>
229
  unordered_multiset(initializer_list<T>, typename see below::size_type = see below,
230
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
231
  -> unordered_multiset<T, Hash, Pred, Allocator>;
 
242
  Hash, Allocator)
243
  -> unordered_multiset<iter-value-type<InputIterator>, Hash,
244
  equal_to<iter-value-type<InputIterator>>,
245
  Allocator>;
246
 
247
+ template<ranges::input_range R, class Allocator>
248
+ unordered_multiset(from_range_t, R&&, typename see below::size_type, Allocator)
249
+ -> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
250
+ equal_to<ranges::range_value_t<R>>, Allocator>;
251
+
252
+ template<ranges::input_range R, class Allocator>
253
+ unordered_multiset(from_range_t, R&&, Allocator)
254
+ -> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
255
+ equal_to<ranges::range_value_t<R>>, Allocator>;
256
+
257
+ template<ranges::input_range R, class Hash, class Allocator>
258
+ unordered_multiset(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
259
+ -> unordered_multiset<ranges::range_value_t<R>, Hash, equal_to<ranges::range_value_t<R>>,
260
+ Allocator>;
261
+
262
  template<class T, class Allocator>
263
  unordered_multiset(initializer_list<T>, typename see below::size_type, Allocator)
264
  -> unordered_multiset<T, hash<T>, equal_to<T>, Allocator>;
265
 
266
  template<class T, class Hash, class Allocator>
267
  unordered_multiset(initializer_list<T>, typename see below::size_type, Hash, Allocator)
268
  -> unordered_multiset<T, Hash, equal_to<T>, Allocator>;
 
 
 
 
 
 
269
  }
270
  ```
271
 
272
  A `size_type` parameter type in an `unordered_multiset` deduction guide
273
  refers to the `size_type` member type of the type deduced by the
 
295
  unordered_multiset(InputIterator f, InputIterator l,
296
  size_type n = see below,
297
  const hasher& hf = hasher(),
298
  const key_equal& eql = key_equal(),
299
  const allocator_type& a = allocator_type());
300
+ template<container-compatible-range<value_type> R>
301
+ unordered_multiset(from_range_t, R&& rg,
302
+ size_type n = see below,
303
+ const hasher& hf = hasher(),
304
+ const key_equal& eql = key_equal(),
305
+ const allocator_type& a = allocator_type());
306
  unordered_multiset(initializer_list<value_type> il,
307
  size_type n = see below,
308
  const hasher& hf = hasher(),
309
  const key_equal& eql = key_equal(),
310
  const allocator_type& a = allocator_type());
 
312
 
313
  *Effects:* Constructs an empty `unordered_multiset` using the specified
314
  hash function, key equality predicate, and allocator, and using at least
315
  `n` buckets. If `n` is not provided, the number of buckets is
316
  *implementation-defined*. Then inserts elements from the range \[`f`,
317
+ `l`), `rg`, or `il`, respectively. `max_load_factor()` returns `1.0`.
 
318
 
319
  *Complexity:* Average case linear, worst case quadratic.
320
 
321
  #### Erasure <a id="unord.multiset.erasure">[[unord.multiset.erasure]]</a>
322