tmp/tmpd4lkciz6/{from.md → to.md}
RENAMED
|
@@ -55,29 +55,33 @@ namespace std {
|
|
| 55 |
return comp(x.first, y.first);
|
| 56 |
}
|
| 57 |
};
|
| 58 |
|
| 59 |
// construct/copy/destroy:
|
| 60 |
-
|
|
|
|
| 61 |
const Allocator& = Allocator());
|
| 62 |
template <class InputIterator>
|
| 63 |
multimap(InputIterator first, InputIterator last,
|
| 64 |
const Compare& comp = Compare(),
|
| 65 |
const Allocator& = Allocator());
|
| 66 |
-
multimap(const multimap
|
| 67 |
-
multimap(multimap
|
| 68 |
explicit multimap(const Allocator&);
|
| 69 |
multimap(const multimap&, const Allocator&);
|
| 70 |
multimap(multimap&&, const Allocator&);
|
| 71 |
multimap(initializer_list<value_type>,
|
| 72 |
const Compare& = Compare(),
|
| 73 |
const Allocator& = Allocator());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
~multimap();
|
| 75 |
-
multimap
|
| 76 |
-
|
| 77 |
-
multimap<Key,T,Compare,Allocator>&
|
| 78 |
-
operator=(multimap<Key,T,Compare,Allocator>&& x);
|
| 79 |
multimap& operator=(initializer_list<value_type>);
|
| 80 |
allocator_type get_allocator() const noexcept;
|
| 81 |
|
| 82 |
// iterators:
|
| 83 |
iterator begin() noexcept;
|
|
@@ -112,31 +116,44 @@ namespace std {
|
|
| 112 |
void insert(initializer_list<value_type>);
|
| 113 |
|
| 114 |
iterator erase(const_iterator position);
|
| 115 |
size_type erase(const key_type& x);
|
| 116 |
iterator erase(const_iterator first, const_iterator last);
|
| 117 |
-
void swap(multimap
|
| 118 |
void clear() noexcept;
|
| 119 |
|
| 120 |
// observers:
|
| 121 |
key_compare key_comp() const;
|
| 122 |
value_compare value_comp() const;
|
| 123 |
|
| 124 |
// map operations:
|
| 125 |
iterator find(const key_type& x);
|
| 126 |
const_iterator find(const key_type& x) const;
|
|
|
|
|
|
|
|
|
|
| 127 |
size_type count(const key_type& x) const;
|
|
|
|
| 128 |
|
| 129 |
iterator lower_bound(const key_type& x);
|
| 130 |
const_iterator lower_bound(const key_type& x) const;
|
|
|
|
|
|
|
|
|
|
| 131 |
iterator upper_bound(const key_type& x);
|
| 132 |
const_iterator upper_bound(const key_type& x) const;
|
|
|
|
|
|
|
| 133 |
|
| 134 |
pair<iterator,iterator>
|
| 135 |
equal_range(const key_type& x);
|
| 136 |
pair<const_iterator,const_iterator>
|
| 137 |
equal_range(const key_type& x) const;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
};
|
| 139 |
|
| 140 |
template <class Key, class T, class Compare, class Allocator>
|
| 141 |
bool operator==(const multimap<Key,T,Compare,Allocator>& x,
|
| 142 |
const multimap<Key,T,Compare,Allocator>& y);
|
|
@@ -164,11 +181,11 @@ namespace std {
|
|
| 164 |
```
|
| 165 |
|
| 166 |
#### `multimap` constructors <a id="multimap.cons">[[multimap.cons]]</a>
|
| 167 |
|
| 168 |
``` cpp
|
| 169 |
-
explicit multimap(const Compare& comp
|
| 170 |
const Allocator& = Allocator());
|
| 171 |
```
|
| 172 |
|
| 173 |
*Effects:* Constructs an empty `multimap` using the specified comparison
|
| 174 |
object and allocator.
|
|
@@ -180,13 +197,13 @@ template <class InputIterator>
|
|
| 180 |
multimap(InputIterator first, InputIterator last,
|
| 181 |
const Compare& comp = Compare(),
|
| 182 |
const Allocator& = Allocator());
|
| 183 |
```
|
| 184 |
|
| 185 |
-
*Requires:* If the iterator’s
|
| 186 |
a const rvalue `pair<key_type, mapped_type>`, then both `key_type` and
|
| 187 |
-
`mapped_type` shall be `
|
| 188 |
|
| 189 |
*Effects:* Constructs an empty `multimap` using the specified comparison
|
| 190 |
object and allocator, and inserts elements from the range \[`first`,
|
| 191 |
`last`).
|
| 192 |
|
|
@@ -198,44 +215,16 @@ sorted using `comp` and otherwise N log N, where N is `last - first`.
|
|
| 198 |
``` cpp
|
| 199 |
template <class P> iterator insert(P&& x);
|
| 200 |
template <class P> iterator insert(const_iterator position, P&& x);
|
| 201 |
```
|
| 202 |
|
| 203 |
-
*
|
|
|
|
|
|
|
| 204 |
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
converted to `value_type` and inserted into the `map`. Specifically, in
|
| 208 |
-
such cases `CopyConstructible` is not required of `key_type` or
|
| 209 |
-
`mapped_type` unless the conversion from `P` specifically requires it
|
| 210 |
-
(e.g., if `P` is a `tuple<const key_type, mapped_type>`, then `key_type`
|
| 211 |
-
must be `CopyConstructible`). The signature taking `InputIterator`
|
| 212 |
-
parameters does not require `CopyConstructible` of either `key_type` or
|
| 213 |
-
`mapped_type` if the dereferenced `InputIterator` returns a non-const
|
| 214 |
-
rvalue `pair<key_type, mapped_type>`. Otherwise `CopyConstructible` is
|
| 215 |
-
required for both `key_type` and `mapped_type`.
|
| 216 |
-
|
| 217 |
-
#### `multimap` operations <a id="multimap.ops">[[multimap.ops]]</a>
|
| 218 |
-
|
| 219 |
-
``` cpp
|
| 220 |
-
iterator find(const key_type &x);
|
| 221 |
-
const_iterator find(const key_type& x) const;
|
| 222 |
-
|
| 223 |
-
iterator lower_bound(const key_type& x);
|
| 224 |
-
const_iterator lower_bound(const key_type& x) const;
|
| 225 |
-
|
| 226 |
-
pair<iterator, iterator>
|
| 227 |
-
equal_range(const key_type& x);
|
| 228 |
-
pair<const_iterator, const_iterator>
|
| 229 |
-
equal_range(const key_type& x) const;
|
| 230 |
-
```
|
| 231 |
-
|
| 232 |
-
The `find`, `lower_bound`, `upper_bound`, and `equal_range` member
|
| 233 |
-
functions each have two versions, one const and one non-const. In each
|
| 234 |
-
case the behavior of the two versions is identical except that the const
|
| 235 |
-
version returns a `const_iterator` and the non-const version an
|
| 236 |
-
`iterator` ([[associative.reqmts]]).
|
| 237 |
|
| 238 |
#### `multimap` specialized algorithms <a id="multimap.special">[[multimap.special]]</a>
|
| 239 |
|
| 240 |
``` cpp
|
| 241 |
template <class Key, class T, class Compare, class Allocator>
|
|
|
|
| 55 |
return comp(x.first, y.first);
|
| 56 |
}
|
| 57 |
};
|
| 58 |
|
| 59 |
// construct/copy/destroy:
|
| 60 |
+
multimap() : multimap(Compare()) { }
|
| 61 |
+
explicit multimap(const Compare& comp,
|
| 62 |
const Allocator& = Allocator());
|
| 63 |
template <class InputIterator>
|
| 64 |
multimap(InputIterator first, InputIterator last,
|
| 65 |
const Compare& comp = Compare(),
|
| 66 |
const Allocator& = Allocator());
|
| 67 |
+
multimap(const multimap& x);
|
| 68 |
+
multimap(multimap&& x);
|
| 69 |
explicit multimap(const Allocator&);
|
| 70 |
multimap(const multimap&, const Allocator&);
|
| 71 |
multimap(multimap&&, const Allocator&);
|
| 72 |
multimap(initializer_list<value_type>,
|
| 73 |
const Compare& = Compare(),
|
| 74 |
const Allocator& = Allocator());
|
| 75 |
+
template <class InputIterator>
|
| 76 |
+
multimap(InputIterator first, InputIterator last, const Allocator& a)
|
| 77 |
+
: multimap(first, last, Compare(), a) { }
|
| 78 |
+
multimap(initializer_list<value_type> il, const Allocator& a)
|
| 79 |
+
: multimap(il, Compare(), a) { }
|
| 80 |
~multimap();
|
| 81 |
+
multimap& operator=(const multimap& x);
|
| 82 |
+
multimap& operator=(multimap&& x);
|
|
|
|
|
|
|
| 83 |
multimap& operator=(initializer_list<value_type>);
|
| 84 |
allocator_type get_allocator() const noexcept;
|
| 85 |
|
| 86 |
// iterators:
|
| 87 |
iterator begin() noexcept;
|
|
|
|
| 116 |
void insert(initializer_list<value_type>);
|
| 117 |
|
| 118 |
iterator erase(const_iterator position);
|
| 119 |
size_type erase(const key_type& x);
|
| 120 |
iterator erase(const_iterator first, const_iterator last);
|
| 121 |
+
void swap(multimap&);
|
| 122 |
void clear() noexcept;
|
| 123 |
|
| 124 |
// observers:
|
| 125 |
key_compare key_comp() const;
|
| 126 |
value_compare value_comp() const;
|
| 127 |
|
| 128 |
// map operations:
|
| 129 |
iterator find(const key_type& x);
|
| 130 |
const_iterator find(const key_type& x) const;
|
| 131 |
+
template <class K> iterator find(const K& x);
|
| 132 |
+
template <class K> const_iterator find(const K& x) const;
|
| 133 |
+
|
| 134 |
size_type count(const key_type& x) const;
|
| 135 |
+
template <class K> size_type count(const K& x) const;
|
| 136 |
|
| 137 |
iterator lower_bound(const key_type& x);
|
| 138 |
const_iterator lower_bound(const key_type& x) const;
|
| 139 |
+
template <class K> iterator lower_bound(const K& x);
|
| 140 |
+
template <class K> const_iterator lower_bound(const K& x) const;
|
| 141 |
+
|
| 142 |
iterator upper_bound(const key_type& x);
|
| 143 |
const_iterator upper_bound(const key_type& x) const;
|
| 144 |
+
template <class K> iterator upper_bound(const K& x);
|
| 145 |
+
template <class K> const_iterator upper_bound(const K& x) const;
|
| 146 |
|
| 147 |
pair<iterator,iterator>
|
| 148 |
equal_range(const key_type& x);
|
| 149 |
pair<const_iterator,const_iterator>
|
| 150 |
equal_range(const key_type& x) const;
|
| 151 |
+
template <class K>
|
| 152 |
+
pair<iterator, iterator> equal_range(const K& x);
|
| 153 |
+
template <class K>
|
| 154 |
+
pair<const_iterator, const_iterator> equal_range(const K& x) const;
|
| 155 |
};
|
| 156 |
|
| 157 |
template <class Key, class T, class Compare, class Allocator>
|
| 158 |
bool operator==(const multimap<Key,T,Compare,Allocator>& x,
|
| 159 |
const multimap<Key,T,Compare,Allocator>& y);
|
|
|
|
| 181 |
```
|
| 182 |
|
| 183 |
#### `multimap` constructors <a id="multimap.cons">[[multimap.cons]]</a>
|
| 184 |
|
| 185 |
``` cpp
|
| 186 |
+
explicit multimap(const Compare& comp,
|
| 187 |
const Allocator& = Allocator());
|
| 188 |
```
|
| 189 |
|
| 190 |
*Effects:* Constructs an empty `multimap` using the specified comparison
|
| 191 |
object and allocator.
|
|
|
|
| 197 |
multimap(InputIterator first, InputIterator last,
|
| 198 |
const Compare& comp = Compare(),
|
| 199 |
const Allocator& = Allocator());
|
| 200 |
```
|
| 201 |
|
| 202 |
+
*Requires:* If the iterator’s indirection operator returns an lvalue or
|
| 203 |
a const rvalue `pair<key_type, mapped_type>`, then both `key_type` and
|
| 204 |
+
`mapped_type` shall be `CopyInsertable` into `*this`.
|
| 205 |
|
| 206 |
*Effects:* Constructs an empty `multimap` using the specified comparison
|
| 207 |
object and allocator, and inserts elements from the range \[`first`,
|
| 208 |
`last`).
|
| 209 |
|
|
|
|
| 215 |
``` cpp
|
| 216 |
template <class P> iterator insert(P&& x);
|
| 217 |
template <class P> iterator insert(const_iterator position, P&& x);
|
| 218 |
```
|
| 219 |
|
| 220 |
+
*Effects:* The first form is equivalent to
|
| 221 |
+
`return emplace(std::forward<P>(x))`. The second form is equivalent to
|
| 222 |
+
`return emplace_hint(position, std::forward<P>(x))`.
|
| 223 |
|
| 224 |
+
*Remarks:* These signatures shall not participate in overload resolution
|
| 225 |
+
unless `std::is_constructible<value_type, P&&>::value` is `true`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
#### `multimap` specialized algorithms <a id="multimap.special">[[multimap.special]]</a>
|
| 228 |
|
| 229 |
``` cpp
|
| 230 |
template <class Key, class T, class Compare, class Allocator>
|