From Jason Turner

[unord.multiset]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpx55rn_gi/{from.md → to.md} +111 -114
tmp/tmpx55rn_gi/{from.md → to.md} RENAMED
@@ -21,10 +21,13 @@ 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
 
 
 
 
26
  ``` cpp
27
  namespace std {
28
  template<class Key,
29
  class Hash = hash<Key>,
30
  class Pred = equal_to<Key>,
@@ -35,12 +38,12 @@ namespace std {
35
  using key_type = Key;
36
  using value_type = Key;
37
  using hasher = Hash;
38
  using key_equal = Pred;
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
 
@@ -49,171 +52,169 @@ namespace std {
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]
51
  using node_type = unspecified;
52
 
53
  // [unord.multiset.cnstr], construct/copy/destroy
54
- unordered_multiset();
55
- explicit unordered_multiset(size_type n,
56
- const hasher& hf = hasher(),
57
  const key_equal& eql = key_equal(),
58
  const allocator_type& a = allocator_type());
59
  template<class InputIterator>
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());
81
- unordered_multiset(size_type n, const allocator_type& a)
82
  : unordered_multiset(n, hasher(), key_equal(), a) { }
83
- unordered_multiset(size_type n, const hasher& hf, const allocator_type& a)
84
  : unordered_multiset(n, hf, key_equal(), a) { }
85
  template<class InputIterator>
86
- unordered_multiset(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
 
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) { }
105
- ~unordered_multiset();
106
- unordered_multiset& operator=(const unordered_multiset&);
107
- unordered_multiset& operator=(unordered_multiset&&)
108
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
109
- is_nothrow_move_assignable_v<Hash> &&
110
- is_nothrow_move_assignable_v<Pred>);
111
- unordered_multiset& operator=(initializer_list<value_type>);
112
- allocator_type get_allocator() const noexcept;
113
 
114
  // iterators
115
- iterator begin() noexcept;
116
- const_iterator begin() const noexcept;
117
- iterator end() noexcept;
118
- const_iterator end() const noexcept;
119
- const_iterator cbegin() const noexcept;
120
- const_iterator cend() const noexcept;
121
 
122
  // capacity
123
- [[nodiscard]] bool empty() const noexcept;
124
- size_type size() const noexcept;
125
- size_type max_size() const noexcept;
126
 
127
  // modifiers
128
- template<class... Args> iterator emplace(Args&&... args);
129
- template<class... Args> iterator emplace_hint(const_iterator position, Args&&... args);
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>);
155
- void clear() noexcept;
156
 
157
  template<class H2, class P2>
158
- void merge(unordered_multiset<Key, H2, P2, Allocator>& source);
159
  template<class H2, class P2>
160
- void merge(unordered_multiset<Key, H2, P2, Allocator>&& source);
161
  template<class H2, class P2>
162
- void merge(unordered_set<Key, H2, P2, Allocator>& source);
163
  template<class H2, class P2>
164
- void merge(unordered_set<Key, H2, P2, Allocator>&& source);
165
 
166
  // observers
167
- hasher hash_function() const;
168
- key_equal key_eq() const;
169
 
170
  // set operations
171
- iterator find(const key_type& k);
172
- const_iterator find(const key_type& k) const;
173
  template<class K>
174
- iterator find(const K& k);
175
  template<class K>
176
- const_iterator find(const K& k) const;
177
- size_type count(const key_type& k) const;
178
  template<class K>
179
- size_type count(const K& k) const;
180
- bool contains(const key_type& k) const;
181
  template<class K>
182
- bool contains(const K& k) const;
183
- pair<iterator, iterator> equal_range(const key_type& k);
184
- pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
185
  template<class K>
186
- pair<iterator, iterator> equal_range(const K& k);
187
  template<class K>
188
- pair<const_iterator, const_iterator> equal_range(const K& k) const;
189
 
190
  // bucket interface
191
- size_type bucket_count() const noexcept;
192
- size_type max_bucket_count() const noexcept;
193
- size_type bucket_size(size_type n) const;
194
- size_type bucket(const key_type& k) const;
195
- local_iterator begin(size_type n);
196
- const_local_iterator begin(size_type n) const;
197
- local_iterator end(size_type n);
198
- const_local_iterator end(size_type n) const;
199
- const_local_iterator cbegin(size_type n) const;
200
- const_local_iterator cend(size_type n) const;
 
201
 
202
  // hash policy
203
- float load_factor() const noexcept;
204
- float max_load_factor() const noexcept;
205
- void max_load_factor(float z);
206
- void rehash(size_type n);
207
- void reserve(size_type n);
208
  };
209
 
210
  template<class InputIterator,
211
  class Hash = hash<iter-value-type<InputIterator>>,
212
  class Pred = equal_to<iter-value-type<InputIterator>>,
213
  class Allocator = allocator<iter-value-type<InputIterator>>>
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,
@@ -274,13 +275,12 @@ refers to the `size_type` member type of the type deduced by the
274
  deduction guide.
275
 
276
  #### Constructors <a id="unord.multiset.cnstr">[[unord.multiset.cnstr]]</a>
277
 
278
  ``` cpp
279
- unordered_multiset() : unordered_multiset(size_type(see below)) { }
280
- explicit unordered_multiset(size_type n,
281
- const hasher& hf = hasher(),
282
  const key_equal& eql = key_equal(),
283
  const allocator_type& a = allocator_type());
284
  ```
285
 
286
  *Effects:* Constructs an empty `unordered_multiset` using the specified
@@ -290,24 +290,21 @@ hash function, key equality predicate, and allocator, and using at least
290
 
291
  *Complexity:* Constant.
292
 
293
  ``` cpp
294
  template<class InputIterator>
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());
311
  ```
312
 
313
  *Effects:* Constructs an empty `unordered_multiset` using the specified
@@ -320,11 +317,11 @@ hash function, key equality predicate, and allocator, and using at least
320
 
321
  #### Erasure <a id="unord.multiset.erasure">[[unord.multiset.erasure]]</a>
322
 
323
  ``` cpp
324
  template<class K, class H, class P, class A, class Predicate>
325
- typename unordered_multiset<K, H, P, A>::size_type
326
  erase_if(unordered_multiset<K, H, P, A>& c, Predicate pred);
327
  ```
328
 
329
  *Effects:* Equivalent to:
330
 
 
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
 
26
+ The types `iterator` and `const_iterator` meet the constexpr iterator
27
+ requirements [[iterator.requirements.general]].
28
+
29
  ``` cpp
30
  namespace std {
31
  template<class Key,
32
  class Hash = hash<Key>,
33
  class Pred = equal_to<Key>,
 
38
  using key_type = Key;
39
  using value_type = Key;
40
  using hasher = Hash;
41
  using key_equal = Pred;
42
  using allocator_type = Allocator;
43
+ using pointer = allocator_traits<Allocator>::pointer;
44
+ using const_pointer = allocator_traits<Allocator>::const_pointer;
45
  using reference = value_type&;
46
  using const_reference = const value_type&;
47
  using size_type = implementation-defined // type of unordered_multiset::size_type; // see [container.requirements]
48
  using difference_type = implementation-defined // type of unordered_multiset::difference_type; // see [container.requirements]
49
 
 
52
  using local_iterator = implementation-defined // type of unordered_multiset::local_iterator; // see [container.requirements]
53
  using const_local_iterator = implementation-defined // type of unordered_multiset::const_local_iterator; // see [container.requirements]
54
  using node_type = unspecified;
55
 
56
  // [unord.multiset.cnstr], construct/copy/destroy
57
+ constexpr unordered_multiset();
58
+ constexpr explicit unordered_multiset(size_type n, const hasher& hf = hasher(),
 
59
  const key_equal& eql = key_equal(),
60
  const allocator_type& a = allocator_type());
61
  template<class InputIterator>
62
+ constexpr unordered_multiset(InputIterator f, InputIterator l,
63
+ size_type n = see below, const hasher& hf = hasher(),
 
64
  const key_equal& eql = key_equal(),
65
  const allocator_type& a = allocator_type());
66
  template<container-compatible-range<value_type> R>
67
+ constexpr unordered_multiset(from_range_t, R&& rg,
68
+ size_type n = see below, const hasher& hf = hasher(),
 
69
  const key_equal& eql = key_equal(),
70
  const allocator_type& a = allocator_type());
71
+ constexpr unordered_multiset(const unordered_multiset&);
72
+ constexpr unordered_multiset(unordered_multiset&&);
73
+ constexpr explicit unordered_multiset(const Allocator&);
74
+ constexpr unordered_multiset(const unordered_multiset&, const type_identity_t<Allocator>&);
75
+ constexpr unordered_multiset(unordered_multiset&&, const type_identity_t<Allocator>&);
76
+ constexpr unordered_multiset(initializer_list<value_type> il,
77
+ size_type n = see below, const hasher& hf = hasher(),
 
78
  const key_equal& eql = key_equal(),
79
  const allocator_type& a = allocator_type());
80
+ constexpr unordered_multiset(size_type n, const allocator_type& a)
81
  : unordered_multiset(n, hasher(), key_equal(), a) { }
82
+ constexpr unordered_multiset(size_type n, const hasher& hf, const allocator_type& a)
83
  : unordered_multiset(n, hf, key_equal(), a) { }
84
  template<class InputIterator>
85
+ constexpr unordered_multiset(InputIterator f, InputIterator l, size_type n,
86
+ const allocator_type& a)
87
  : unordered_multiset(f, l, n, hasher(), key_equal(), a) { }
88
  template<class InputIterator>
89
+ constexpr unordered_multiset(InputIterator f, InputIterator l, size_type n,
90
+ const hasher& hf, const allocator_type& a)
91
  : unordered_multiset(f, l, n, hf, key_equal(), a) { }
92
  template<container-compatible-range<value_type> R>
93
+ constexpr 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
+ constexpr 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
+ constexpr unordered_multiset(initializer_list<value_type> il, size_type n,
101
+ const allocator_type& a)
102
  : unordered_multiset(il, n, hasher(), key_equal(), a) { }
103
+ constexpr unordered_multiset(initializer_list<value_type> il, size_type n, const hasher& hf,
104
  const allocator_type& a)
105
  : unordered_multiset(il, n, hf, key_equal(), a) { }
106
+ constexpr ~unordered_multiset();
107
+ constexpr unordered_multiset& operator=(const unordered_multiset&);
108
+ constexpr unordered_multiset& operator=(unordered_multiset&&)
109
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
110
+ is_nothrow_move_assignable_v<Hash> && is_nothrow_move_assignable_v<Pred>);
111
+ constexpr unordered_multiset& operator=(initializer_list<value_type>);
112
+ constexpr allocator_type get_allocator() const noexcept;
 
113
 
114
  // iterators
115
+ constexpr iterator begin() noexcept;
116
+ constexpr const_iterator begin() const noexcept;
117
+ constexpr iterator end() noexcept;
118
+ constexpr const_iterator end() const noexcept;
119
+ constexpr const_iterator cbegin() const noexcept;
120
+ constexpr const_iterator cend() const noexcept;
121
 
122
  // capacity
123
+ constexpr bool empty() const noexcept;
124
+ constexpr size_type size() const noexcept;
125
+ constexpr size_type max_size() const noexcept;
126
 
127
  // modifiers
128
+ template<class... Args> constexpr iterator emplace(Args&&... args);
129
+ template<class... Args>
130
+ constexpr iterator emplace_hint(const_iterator position, Args&&... args);
131
+ constexpr iterator insert(const value_type& obj);
132
+ constexpr iterator insert(value_type&& obj);
133
+ constexpr iterator insert(const_iterator hint, const value_type& obj);
134
+ constexpr iterator insert(const_iterator hint, value_type&& obj);
135
+ template<class InputIterator> constexpr void insert(InputIterator first, InputIterator last);
136
  template<container-compatible-range<value_type> R>
137
+ constexpr void insert_range(R&& rg);
138
+ constexpr void insert(initializer_list<value_type>);
139
 
140
+ constexpr node_type extract(const_iterator position);
141
+ constexpr node_type extract(const key_type& x);
142
+ template<class K> constexpr node_type extract(K&& x);
143
+ constexpr iterator insert(node_type&& nh);
144
+ constexpr iterator insert(const_iterator hint, node_type&& nh);
145
 
146
+ constexpr iterator erase(iterator position)
147
  requires (!same_as<iterator, const_iterator>);
148
+ constexpr iterator erase(const_iterator position);
149
+ constexpr size_type erase(const key_type& k);
150
+ template<class K> constexpr size_type erase(K&& x);
151
+ constexpr iterator erase(const_iterator first, const_iterator last);
152
+ constexpr void swap(unordered_multiset&)
153
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
154
+ is_nothrow_swappable_v<Hash> && is_nothrow_swappable_v<Pred>);
155
+ constexpr void clear() noexcept;
 
156
 
157
  template<class H2, class P2>
158
+ constexpr void merge(unordered_multiset<Key, H2, P2, Allocator>& source);
159
  template<class H2, class P2>
160
+ constexpr void merge(unordered_multiset<Key, H2, P2, Allocator>&& source);
161
  template<class H2, class P2>
162
+ constexpr void merge(unordered_set<Key, H2, P2, Allocator>& source);
163
  template<class H2, class P2>
164
+ constexpr void merge(unordered_set<Key, H2, P2, Allocator>&& source);
165
 
166
  // observers
167
+ constexpr hasher hash_function() const;
168
+ constexpr key_equal key_eq() const;
169
 
170
  // set operations
171
+ constexpr iterator find(const key_type& k);
172
+ constexpr const_iterator find(const key_type& k) const;
173
  template<class K>
174
+ constexpr iterator find(const K& k);
175
  template<class K>
176
+ constexpr const_iterator find(const K& k) const;
177
+ constexpr size_type count(const key_type& k) const;
178
  template<class K>
179
+ constexpr size_type count(const K& k) const;
180
+ constexpr bool contains(const key_type& k) const;
181
  template<class K>
182
+ constexpr bool contains(const K& k) const;
183
+ constexpr pair<iterator, iterator> equal_range(const key_type& k);
184
+ constexpr pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
185
  template<class K>
186
+ constexpr pair<iterator, iterator> equal_range(const K& k);
187
  template<class K>
188
+ constexpr pair<const_iterator, const_iterator> equal_range(const K& k) const;
189
 
190
  // bucket interface
191
+ constexpr size_type bucket_count() const noexcept;
192
+ constexpr size_type max_bucket_count() const noexcept;
193
+ constexpr size_type bucket_size(size_type n) const;
194
+ constexpr size_type bucket(const key_type& k) const;
195
+ template<class K> constexpr size_type bucket(const K& k) const;
196
+ constexpr local_iterator begin(size_type n);
197
+ constexpr const_local_iterator begin(size_type n) const;
198
+ constexpr local_iterator end(size_type n);
199
+ constexpr const_local_iterator end(size_type n) const;
200
+ constexpr const_local_iterator cbegin(size_type n) const;
201
+ constexpr const_local_iterator cend(size_type n) const;
202
 
203
  // hash policy
204
+ constexpr float load_factor() const noexcept;
205
+ constexpr float max_load_factor() const noexcept;
206
+ constexpr void max_load_factor(float z);
207
+ constexpr void rehash(size_type n);
208
+ constexpr void reserve(size_type n);
209
  };
210
 
211
  template<class InputIterator,
212
  class Hash = hash<iter-value-type<InputIterator>>,
213
  class Pred = equal_to<iter-value-type<InputIterator>>,
214
  class Allocator = allocator<iter-value-type<InputIterator>>>
215
+ unordered_multiset(InputIterator, InputIterator, typename see below::size_type = see below,
216
  Hash = Hash(), Pred = Pred(), Allocator = Allocator())
217
  -> unordered_multiset<iter-value-type<InputIterator>,
218
  Hash, Pred, Allocator>;
219
 
220
  template<ranges::input_range R,
 
275
  deduction guide.
276
 
277
  #### Constructors <a id="unord.multiset.cnstr">[[unord.multiset.cnstr]]</a>
278
 
279
  ``` cpp
280
+ constexpr unordered_multiset() : unordered_multiset(size_type(see below)) { }
281
+ constexpr explicit unordered_multiset(size_type n, const hasher& hf = hasher(),
 
282
  const key_equal& eql = key_equal(),
283
  const allocator_type& a = allocator_type());
284
  ```
285
 
286
  *Effects:* Constructs an empty `unordered_multiset` using the specified
 
290
 
291
  *Complexity:* Constant.
292
 
293
  ``` cpp
294
  template<class InputIterator>
295
+ constexpr unordered_multiset(InputIterator f, InputIterator l,
296
+ size_type n = see below, const hasher& hf = hasher(),
 
297
  const key_equal& eql = key_equal(),
298
  const allocator_type& a = allocator_type());
299
  template<container-compatible-range<value_type> R>
300
+ constexpr unordered_multiset(from_range_t, R&& rg,
301
+ size_type n = see below, const hasher& hf = hasher(),
 
302
  const key_equal& eql = key_equal(),
303
  const allocator_type& a = allocator_type());
304
+ constexpr unordered_multiset(initializer_list<value_type> il,
305
+ size_type n = see below, const hasher& hf = hasher(),
 
306
  const key_equal& eql = key_equal(),
307
  const allocator_type& a = allocator_type());
308
  ```
309
 
310
  *Effects:* Constructs an empty `unordered_multiset` using the specified
 
317
 
318
  #### Erasure <a id="unord.multiset.erasure">[[unord.multiset.erasure]]</a>
319
 
320
  ``` cpp
321
  template<class K, class H, class P, class A, class Predicate>
322
+ constexpr typename unordered_multiset<K, H, P, A>::size_type
323
  erase_if(unordered_multiset<K, H, P, A>& c, Predicate pred);
324
  ```
325
 
326
  *Effects:* Equivalent to:
327