From Jason Turner

[unord.multimap.overview]

Diff to HTML by rtfpessoa

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