From Jason Turner

[unord.multimap]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_ks6a5hv/{from.md → to.md} +30 -26
tmp/tmp_ks6a5hv/{from.md → to.md} RENAMED
@@ -36,24 +36,25 @@ namespace std {
36
  typedef std::pair<const Key, T> value_type;
37
  typedef T mapped_type;
38
  typedef Hash hasher;
39
  typedef Pred key_equal;
40
  typedef Allocator allocator_type;
41
- typedef typename allocator_type::pointer pointer;
42
- typedef typename allocator_type::const_pointer const_pointer;
43
- typedef typename allocator_type::reference reference;
44
- typedef typename allocator_type::const_reference const_reference;
45
  typedef implementation-defined size_type;
46
  typedef implementation-defined difference_type;
47
 
48
  typedef implementation-defined iterator;
49
  typedef implementation-defined const_iterator;
50
  typedef implementation-defined local_iterator;
51
  typedef implementation-defined const_local_iterator;
52
 
53
  // construct/destroy/copy
54
- explicit unordered_multimap(size_type n = see below,
 
55
  const hasher& hf = hasher(),
56
  const key_equal& eql = key_equal(),
57
  const allocator_type& a = allocator_type());
58
  template <class InputIterator>
59
  unordered_multimap(InputIterator f, InputIterator l,
@@ -69,10 +70,26 @@ namespace std {
69
  unordered_multimap(initializer_list<value_type>,
70
  size_type = see below,
71
  const hasher& hf = hasher(),
72
  const key_equal& eql = key_equal(),
73
  const allocator_type& a = allocator_type());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  ~unordered_multimap();
75
  unordered_multimap& operator=(const unordered_multimap&);
76
  unordered_multimap& operator=(unordered_multimap&&);
77
  unordered_multimap& operator=(initializer_list<value_type>);
78
  allocator_type get_allocator() const noexcept;
@@ -152,19 +169,20 @@ namespace std {
152
  ```
153
 
154
  #### `unordered_multimap` constructors <a id="unord.multimap.cnstr">[[unord.multimap.cnstr]]</a>
155
 
156
  ``` cpp
157
- explicit unordered_multimap(size_type n = see below,
 
158
  const hasher& hf = hasher(),
159
  const key_equal& eql = key_equal(),
160
  const allocator_type& a = allocator_type());
161
  ```
162
 
163
  *Effects:* Constructs an empty `unordered_multimap` using the specified
164
  hash function, key equality function, and allocator, and using at least
165
- *`n`* buckets. If *`n`* is not provided, the number of buckets is
166
  *implementation-defined*. `max_load_factor()` returns 1.0.
167
 
168
  *Complexity:* Constant.
169
 
170
  ``` cpp
@@ -189,39 +207,25 @@ hash function, key equality function, and allocator, and using at least
189
  ``` cpp
190
  template <class P>
191
  iterator insert(P&& obj);
192
  ```
193
 
194
- *Requires:* `value_type` is constructible from `std::forward<P>(obj)`.
195
-
196
- *Effects:* Inserts `obj` converted to `value_type`.
197
-
198
- *Returns:* An iterator that points to the element with key equivalent to
199
- the key of `value_type(obj)`.
200
-
201
- *Complexity:* Average case 𝑂(1), worst case 𝑂(`size()`).
202
 
203
  *Remarks:* This signature shall not participate in overload resolution
204
- unless `P` is implicitly convertible to `value_type`.
205
 
206
  ``` cpp
207
  template <class P>
208
  iterator insert(const_iterator hint, P&& obj);
209
  ```
210
 
211
- *Requires:* `value_type` is constructible from `std::forward<P>(obj)`.
212
-
213
- *Effects:* Inserts `obj` converted to `value_type`. The iterator `hint`
214
- is a hint pointing to where the search should start.
215
-
216
- *Returns:* An iterator that points to the element with key equivalent to
217
- the key of `value_type(obj)`.
218
-
219
- *Complexity:* Average case 𝑂(1), worst case 𝑂(`size()`).
220
 
221
  *Remarks:* This signature shall not participate in overload resolution
222
- unless `P` is implicitly convertible to `value_type`.
223
 
224
  #### `unordered_multimap` swap <a id="unord.multimap.swap">[[unord.multimap.swap]]</a>
225
 
226
  ``` cpp
227
  template <class Key, class T, class Hash, class Pred, class Alloc>
 
36
  typedef std::pair<const Key, T> value_type;
37
  typedef T mapped_type;
38
  typedef Hash hasher;
39
  typedef Pred key_equal;
40
  typedef Allocator allocator_type;
41
+ typedef typename allocator_traits<Allocator>::pointer pointer;
42
+ typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
43
+ typedef value_type& reference;
44
+ typedef const value_type& const_reference;
45
  typedef implementation-defined size_type;
46
  typedef implementation-defined difference_type;
47
 
48
  typedef implementation-defined iterator;
49
  typedef implementation-defined const_iterator;
50
  typedef implementation-defined local_iterator;
51
  typedef implementation-defined const_local_iterator;
52
 
53
  // construct/destroy/copy
54
+ unordered_multimap();
55
+ explicit unordered_multimap(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_multimap(InputIterator f, InputIterator l,
 
70
  unordered_multimap(initializer_list<value_type>,
71
  size_type = see below,
72
  const hasher& hf = hasher(),
73
  const key_equal& eql = key_equal(),
74
  const allocator_type& a = allocator_type());
75
+ unordered_multimap(size_type n, const allocator_type& a)
76
+ : unordered_multimap(n, hasher(), key_equal(), a) { }
77
+ unordered_multimap(size_type n, const hasher& hf, const allocator_type& a)
78
+ : unordered_multimap(n, hf, key_equal(), a) { }
79
+ template <class InputIterator>
80
+ unordered_multimap(InputIterator f, InputIterator l, size_type n, const allocator_type& a)
81
+ : unordered_multimap(f, l, n, hasher(), key_equal(), a) { }
82
+ template <class InputIterator>
83
+ unordered_multimap(InputIterator f, InputIterator l, size_type n, const hasher& hf,
84
+ const allocator_type& a)
85
+ : unordered_multimap(f, l, n, hf, key_equal(), a) { }
86
+ unordered_multimap(initializer_list<value_type> il, size_type n, const allocator_type& a)
87
+ : unordered_multimap(il, n, hasher(), key_equal(), a) { }
88
+ unordered_multimap(initializer_list<value_type> il, size_type n, const hasher& hf,
89
+ const allocator_type& a)
90
+ : unordered_multimap(il, n, hf, key_equal(), a) { }
91
  ~unordered_multimap();
92
  unordered_multimap& operator=(const unordered_multimap&);
93
  unordered_multimap& operator=(unordered_multimap&&);
94
  unordered_multimap& operator=(initializer_list<value_type>);
95
  allocator_type get_allocator() const noexcept;
 
169
  ```
170
 
171
  #### `unordered_multimap` constructors <a id="unord.multimap.cnstr">[[unord.multimap.cnstr]]</a>
172
 
173
  ``` cpp
174
+ unordered_multimap() : unordered_multimap(size_type(see below)) { }
175
+ explicit unordered_multimap(size_type n,
176
  const hasher& hf = hasher(),
177
  const key_equal& eql = key_equal(),
178
  const allocator_type& a = allocator_type());
179
  ```
180
 
181
  *Effects:* Constructs an empty `unordered_multimap` using the specified
182
  hash function, key equality function, and allocator, and using at least
183
+ *`n`* buckets. For the default constructor, the number of buckets is
184
  *implementation-defined*. `max_load_factor()` returns 1.0.
185
 
186
  *Complexity:* Constant.
187
 
188
  ``` cpp
 
207
  ``` cpp
208
  template <class P>
209
  iterator insert(P&& obj);
210
  ```
211
 
212
+ *Effects:* Equivalent to `return emplace(std::forward<P>(obj))`.
 
 
 
 
 
 
 
213
 
214
  *Remarks:* This signature shall not participate in overload resolution
215
+ unless `std::is_constructible<value_type, P&&>::value` is `true`.
216
 
217
  ``` cpp
218
  template <class P>
219
  iterator insert(const_iterator hint, P&& obj);
220
  ```
221
 
222
+ *Effects:* Equivalent to
223
+ `return emplace_hint(hint, std::forward<P>(obj))`.
 
 
 
 
 
 
 
224
 
225
  *Remarks:* This signature shall not participate in overload resolution
226
+ unless `std::is_constructible<value_type, P&&>::value` is `true`.
227
 
228
  #### `unordered_multimap` swap <a id="unord.multimap.swap">[[unord.multimap.swap]]</a>
229
 
230
  ``` cpp
231
  template <class Key, class T, class Hash, class Pred, class Alloc>