From Jason Turner

[unord.multiset.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp9pa0tcop/{from.md → to.md} +57 -20
tmp/tmp9pa0tcop/{from.md → to.md} RENAMED
@@ -4,19 +4,20 @@ An `unordered_multiset` is an unordered associative container that
4
  supports equivalent keys (an instance of `unordered_multiset` may
5
  contain multiple copies of the same key value) and in which each
6
  element’s key is the element itself. The `unordered_multiset` class
7
  supports forward iterators.
8
 
9
- An `unordered_multiset` meets all of the requirements of a container, of
10
- an unordered associative container, and of an allocator-aware container
11
- ([[container.alloc.req]]). It provides the operations described in the
12
- preceding requirements table for equivalent keys; that is, an
13
- `unordered_multiset` supports the `a_eq` operations in that table, not
14
- the `a_uniq` operations. For an `unordered_multiset<Key>` the `key type`
15
- and the value type are both `Key`. The `iterator` and `const_iterator`
16
- types are both constant iterator types. It is unspecified whether they
17
- are the same type.
 
18
 
19
  Subclause  [[unord.multiset]] only describes operations on
20
  `unordered_multiset` that are not described in one of the requirement
21
  tables, or for which there is additional semantic information.
22
 
@@ -36,12 +37,12 @@ namespace std {
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]
@@ -57,15 +58,21 @@ namespace std {
57
  unordered_multiset(InputIterator f, InputIterator l,
58
  size_type n = see below,
59
  const hasher& hf = hasher(),
60
  const key_equal& eql = key_equal(),
61
  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());
@@ -78,10 +85,18 @@ namespace std {
78
  : unordered_multiset(f, l, n, hasher(), key_equal(), a) { }
79
  template<class InputIterator>
80
  unordered_multiset(InputIterator f, InputIterator l, size_type n, const hasher& hf,
81
  const allocator_type& a)
82
  : unordered_multiset(f, l, n, hf, key_equal(), a) { }
 
 
 
 
 
 
 
 
83
  unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a)
84
  : unordered_multiset(il, 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) { }
@@ -113,20 +128,25 @@ namespace std {
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>);
@@ -192,10 +212,18 @@ namespace std {
192
  unordered_multiset(InputIterator, InputIterator, see below::size_type = see below,
193
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
194
  -> unordered_multiset<iter-value-type<InputIterator>,
195
  Hash, Pred, Allocator>;
196
 
 
 
 
 
 
 
 
 
197
  template<class T, class Hash = hash<T>,
198
  class Pred = equal_to<T>, class Allocator = allocator<T>>
199
  unordered_multiset(initializer_list<T>, typename see below::size_type = see below,
200
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
201
  -> unordered_multiset<T, Hash, Pred, Allocator>;
@@ -212,23 +240,32 @@ namespace std {
212
  Hash, Allocator)
213
  -> unordered_multiset<iter-value-type<InputIterator>, Hash,
214
  equal_to<iter-value-type<InputIterator>>,
215
  Allocator>;
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  template<class T, class Allocator>
218
  unordered_multiset(initializer_list<T>, typename see below::size_type, Allocator)
219
  -> unordered_multiset<T, hash<T>, equal_to<T>, Allocator>;
220
 
221
  template<class T, class Hash, class Allocator>
222
  unordered_multiset(initializer_list<T>, typename see below::size_type, Hash, Allocator)
223
  -> unordered_multiset<T, Hash, equal_to<T>, Allocator>;
224
-
225
- // swap
226
- template<class Key, class Hash, class Pred, class Alloc>
227
- void swap(unordered_multiset<Key, Hash, Pred, Alloc>& x,
228
- unordered_multiset<Key, Hash, Pred, Alloc>& y)
229
- noexcept(noexcept(x.swap(y)));
230
  }
231
  ```
232
 
233
  A `size_type` parameter type in an `unordered_multiset` deduction guide
234
  refers to the `size_type` member type of the type deduced by the
 
4
  supports equivalent keys (an instance of `unordered_multiset` may
5
  contain multiple copies of the same key value) and in which each
6
  element’s key is the element itself. The `unordered_multiset` class
7
  supports forward iterators.
8
 
9
+ An `unordered_multiset` meets all of the requirements of a container
10
+ [[container.reqmts]], of an allocator-aware container
11
+ [[container.alloc.reqmts]], and of an unordered associative container
12
+ [[unord.req]]. It provides the operations described in the preceding
13
+ requirements table for equivalent keys; that is, an `unordered_multiset`
14
+ supports the `a_eq` operations in that table, not the `a_uniq`
15
+ operations. For an `unordered_multiset<Key>` the `key_type` and the
16
+ `value_type` are both `Key`. The `iterator` and `const_iterator` types
17
+ are both constant iterator types. It is unspecified whether they are the
18
+ same type.
19
 
20
  Subclause  [[unord.multiset]] only describes operations on
21
  `unordered_multiset` that are not described in one of the requirement
22
  tables, or for which there is additional semantic information.
23
 
 
37
  using allocator_type = Allocator;
38
  using pointer = typename allocator_traits<Allocator>::pointer;
39
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
40
  using reference = value_type&;
41
  using const_reference = const value_type&;
42
+ using size_type = implementation-defined // type of unordered_multiset::size_type; // see [container.requirements]
43
+ using difference_type = implementation-defined // type of unordered_multiset::difference_type; // see [container.requirements]
44
 
45
  using iterator = implementation-defined // type of unordered_multiset::iterator; // see [container.requirements]
46
  using const_iterator = implementation-defined // type of unordered_multiset::const_iterator; // see [container.requirements]
47
  using local_iterator = implementation-defined // type of unordered_multiset::local_iterator; // see [container.requirements]
48
  using const_local_iterator = implementation-defined // type of unordered_multiset::const_local_iterator; // see [container.requirements]
 
58
  unordered_multiset(InputIterator f, InputIterator l,
59
  size_type n = see below,
60
  const hasher& hf = hasher(),
61
  const key_equal& eql = key_equal(),
62
  const allocator_type& a = allocator_type());
63
+ template<container-compatible-range<value_type> R>
64
+ unordered_multiset(from_range_t, R&& rg,
65
+ size_type n = see below,
66
+ const hasher& hf = hasher(),
67
+ const key_equal& eql = key_equal(),
68
+ const allocator_type& a = allocator_type());
69
  unordered_multiset(const unordered_multiset&);
70
  unordered_multiset(unordered_multiset&&);
71
  explicit unordered_multiset(const Allocator&);
72
+ unordered_multiset(const unordered_multiset&, const type_identity_t<Allocator>&);
73
+ unordered_multiset(unordered_multiset&&, const type_identity_t<Allocator>&);
74
  unordered_multiset(initializer_list<value_type> il,
75
  size_type n = see below,
76
  const hasher& hf = hasher(),
77
  const key_equal& eql = key_equal(),
78
  const allocator_type& a = allocator_type());
 
85
  : unordered_multiset(f, l, n, hasher(), key_equal(), a) { }
86
  template<class InputIterator>
87
  unordered_multiset(InputIterator f, InputIterator l, size_type n, const hasher& hf,
88
  const allocator_type& a)
89
  : unordered_multiset(f, l, n, hf, key_equal(), a) { }
90
+ template<container-compatible-range<value_type> R>
91
+ unordered_multiset(from_range_t, R&& rg, size_type n, const allocator_type& a)
92
+ : unordered_multiset(from_range, std::forward<R>(rg),
93
+ n, hasher(), key_equal(), a) { }
94
+ template<container-compatible-range<value_type> R>
95
+ unordered_multiset(from_range_t, R&& rg, size_type n, const hasher& hf,
96
+ const allocator_type& a)
97
+ : unordered_multiset(from_range, std::forward<R>(rg), n, hf, key_equal(), a) { }
98
  unordered_multiset(initializer_list<value_type> il, size_type n, const allocator_type& a)
99
  : unordered_multiset(il, n, hasher(), key_equal(), a) { }
100
  unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
101
  const allocator_type& a)
102
  : unordered_multiset(il, n, hf, key_equal(), a) { }
 
128
  iterator insert(const value_type& obj);
129
  iterator insert(value_type&& obj);
130
  iterator insert(const_iterator hint, const value_type& obj);
131
  iterator insert(const_iterator hint, value_type&& obj);
132
  template<class InputIterator> void insert(InputIterator first, InputIterator last);
133
+ template<container-compatible-range<value_type> R>
134
+ void insert_range(R&& rg);
135
  void insert(initializer_list<value_type>);
136
 
137
  node_type extract(const_iterator position);
138
  node_type extract(const key_type& x);
139
+ template<class K> node_type extract(K&& x);
140
  iterator insert(node_type&& nh);
141
  iterator insert(const_iterator hint, node_type&& nh);
142
 
143
+ iterator erase(iterator position)
144
+ requires (!same_as<iterator, const_iterator>);
145
  iterator erase(const_iterator position);
146
  size_type erase(const key_type& k);
147
+ template<class K> size_type erase(K&& x);
148
  iterator erase(const_iterator first, const_iterator last);
149
  void swap(unordered_multiset&)
150
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
151
  is_nothrow_swappable_v<Hash> &&
152
  is_nothrow_swappable_v<Pred>);
 
212
  unordered_multiset(InputIterator, InputIterator, see below::size_type = see below,
213
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
214
  -> unordered_multiset<iter-value-type<InputIterator>,
215
  Hash, Pred, Allocator>;
216
 
217
+ template<ranges::input_range R,
218
+ class Hash = hash<ranges::range_value_t<R>>,
219
+ class Pred = equal_to<ranges::range_value_t<R>>,
220
+ class Allocator = allocator<ranges::range_value_t<R>>>
221
+ unordered_multiset(from_range_t, R&&, typename see below::size_type = see below,
222
+ Hash = Hash(), Pred = Pred(), Allocator = Allocator())
223
+ -> unordered_multiset<ranges::range_value_t<R>, Hash, Pred, Allocator>;
224
+
225
  template<class T, class Hash = hash<T>,
226
  class Pred = equal_to<T>, class Allocator = allocator<T>>
227
  unordered_multiset(initializer_list<T>, typename see below::size_type = see below,
228
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
229
  -> unordered_multiset<T, Hash, Pred, Allocator>;
 
240
  Hash, Allocator)
241
  -> unordered_multiset<iter-value-type<InputIterator>, Hash,
242
  equal_to<iter-value-type<InputIterator>>,
243
  Allocator>;
244
 
245
+ template<ranges::input_range R, class Allocator>
246
+ unordered_multiset(from_range_t, R&&, typename see below::size_type, Allocator)
247
+ -> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
248
+ equal_to<ranges::range_value_t<R>>, Allocator>;
249
+
250
+ template<ranges::input_range R, class Allocator>
251
+ unordered_multiset(from_range_t, R&&, Allocator)
252
+ -> unordered_multiset<ranges::range_value_t<R>, hash<ranges::range_value_t<R>>,
253
+ equal_to<ranges::range_value_t<R>>, Allocator>;
254
+
255
+ template<ranges::input_range R, class Hash, class Allocator>
256
+ unordered_multiset(from_range_t, R&&, typename see below::size_type, Hash, Allocator)
257
+ -> unordered_multiset<ranges::range_value_t<R>, Hash, equal_to<ranges::range_value_t<R>>,
258
+ Allocator>;
259
+
260
  template<class T, class Allocator>
261
  unordered_multiset(initializer_list<T>, typename see below::size_type, Allocator)
262
  -> unordered_multiset<T, hash<T>, equal_to<T>, Allocator>;
263
 
264
  template<class T, class Hash, class Allocator>
265
  unordered_multiset(initializer_list<T>, typename see below::size_type, Hash, Allocator)
266
  -> unordered_multiset<T, Hash, equal_to<T>, Allocator>;
 
 
 
 
 
 
267
  }
268
  ```
269
 
270
  A `size_type` parameter type in an `unordered_multiset` deduction guide
271
  refers to the `size_type` member type of the type deduced by the