From Jason Turner

[unord.multiset.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4_g7vuar/{from.md → to.md} +47 -41
tmp/tmp4_g7vuar/{from.md → to.md} RENAMED
@@ -1,36 +1,36 @@
1
- #### Class template `unordered_multiset` overview <a id="unord.multiset.overview">[[unord.multiset.overview]]</a>
2
 
3
  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` satisfies all of the requirements of a
10
- 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 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;
@@ -92,24 +92,24 @@ namespace std {
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);
@@ -139,22 +139,35 @@ namespace std {
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,69 +175,62 @@ namespace std {
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
 
 
1
+ #### Overview <a id="unord.multiset.overview">[[unord.multiset.overview]]</a>
2
 
3
  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
 
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;
 
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
+ [[nodiscard]] 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);
 
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
+ template<class K>
152
+ iterator find(const K& k);
153
+ template<class K>
154
+ const_iterator find(const K& k) const;
155
  size_type count(const key_type& k) const;
156
+ template<class K>
157
+ size_type count(const K& k) const;
158
+ bool contains(const key_type& k) const;
159
+ template<class K>
160
+ bool contains(const K& k) const;
161
  pair<iterator, iterator> equal_range(const key_type& k);
162
  pair<const_iterator, const_iterator> equal_range(const key_type& k) const;
163
+ template<class K>
164
+ pair<iterator, iterator> equal_range(const K& k);
165
+ template<class K>
166
+ pair<const_iterator, const_iterator> equal_range(const K& k) const;
167
 
168
+ // bucket interface
169
  size_type bucket_count() const noexcept;
170
  size_type max_bucket_count() const noexcept;
171
  size_type bucket_size(size_type n) const;
172
  size_type bucket(const key_type& k) const;
173
  local_iterator begin(size_type n);
 
175
  local_iterator end(size_type n);
176
  const_local_iterator end(size_type n) const;
177
  const_local_iterator cbegin(size_type n) const;
178
  const_local_iterator cend(size_type n) const;
179
 
180
+ // hash policy
181
  float load_factor() const noexcept;
182
  float max_load_factor() const noexcept;
183
  void max_load_factor(float z);
184
  void rehash(size_type n);
185
  void reserve(size_type n);
186
  };
187
 
188
  template<class InputIterator,
189
+ class Hash = hash<iter-value-type<InputIterator>>,
190
+ class Pred = equal_to<iter-value-type<InputIterator>>,
191
+ class Allocator = allocator<iter-value-type<InputIterator>>>
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>;
202
 
203
  template<class InputIterator, class Allocator>
204
  unordered_multiset(InputIterator, InputIterator, typename see below::size_type, Allocator)
205
+ -> unordered_multiset<iter-value-type<InputIterator>,
206
+ hash<iter-value-type<InputIterator>>,
207
+ equal_to<iter-value-type<InputIterator>>,
208
  Allocator>;
209
 
210
  template<class InputIterator, class Hash, class Allocator>
211
  unordered_multiset(InputIterator, InputIterator, typename see below::size_type,
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
235
+ deduction guide.
236