tmp/tmpn4kclk2b/{from.md → to.md}
RENAMED
|
@@ -16,10 +16,13 @@ not the `a_uniq` operations. For a `multimap<Key,T>` the `key_type` is
|
|
| 16 |
`Key` and the `value_type` is `pair<const Key,T>`. Descriptions are
|
| 17 |
provided here only for operations on `multimap` that are not described
|
| 18 |
in one of those tables or for operations where there is additional
|
| 19 |
semantic information.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
``` cpp
|
| 22 |
namespace std {
|
| 23 |
template<class Key, class T, class Compare = less<Key>,
|
| 24 |
class Allocator = allocator<pair<const Key, T>>>
|
| 25 |
class multimap {
|
|
@@ -28,12 +31,12 @@ namespace std {
|
|
| 28 |
using key_type = Key;
|
| 29 |
using mapped_type = T;
|
| 30 |
using value_type = pair<const Key, T>;
|
| 31 |
using key_compare = Compare;
|
| 32 |
using allocator_type = Allocator;
|
| 33 |
-
using pointer =
|
| 34 |
-
using const_pointer =
|
| 35 |
using reference = value_type&;
|
| 36 |
using const_reference = const value_type&;
|
| 37 |
using size_type = implementation-defined // type of multimap::size_type; // see [container.requirements]
|
| 38 |
using difference_type = implementation-defined // type of multimap::difference_type; // see [container.requirements]
|
| 39 |
using iterator = implementation-defined // type of multimap::iterator; // see [container.requirements]
|
|
@@ -41,148 +44,146 @@ namespace std {
|
|
| 41 |
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 42 |
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 43 |
using node_type = unspecified;
|
| 44 |
|
| 45 |
class value_compare {
|
| 46 |
-
friend class multimap;
|
| 47 |
protected:
|
| 48 |
Compare comp;
|
| 49 |
-
value_compare(Compare c) : comp(c) { }
|
| 50 |
|
| 51 |
public:
|
| 52 |
-
bool operator()(const value_type& x, const value_type& y) const {
|
| 53 |
return comp(x.first, y.first);
|
| 54 |
}
|
| 55 |
};
|
| 56 |
|
| 57 |
// [multimap.cons], construct/copy/destroy
|
| 58 |
-
multimap() : multimap(Compare()) { }
|
| 59 |
-
explicit multimap(const Compare& comp, const Allocator& = Allocator());
|
| 60 |
template<class InputIterator>
|
| 61 |
-
multimap(InputIterator first, InputIterator last,
|
| 62 |
-
|
| 63 |
-
const Allocator& = Allocator());
|
| 64 |
template<container-compatible-range<value_type> R>
|
| 65 |
-
multimap(from_range_t, R&& rg,
|
| 66 |
const Compare& comp = Compare(), const Allocator& = Allocator());
|
| 67 |
-
multimap(const multimap& x);
|
| 68 |
-
multimap(multimap&& x);
|
| 69 |
-
explicit multimap(const Allocator&);
|
| 70 |
-
multimap(const multimap&, const type_identity_t<Allocator>&);
|
| 71 |
-
multimap(multimap&&, const type_identity_t<Allocator>&);
|
| 72 |
-
multimap(initializer_list<value_type>,
|
| 73 |
-
|
| 74 |
-
const Allocator& = Allocator());
|
| 75 |
template<class InputIterator>
|
| 76 |
-
multimap(InputIterator first, InputIterator last, const Allocator& a)
|
| 77 |
: multimap(first, last, Compare(), a) { }
|
| 78 |
template<container-compatible-range<value_type> R>
|
| 79 |
-
multimap(from_range_t, R&& rg, const Allocator& a)
|
| 80 |
: multimap(from_range, std::forward<R>(rg), Compare(), a) { }
|
| 81 |
-
multimap(initializer_list<value_type> il, const Allocator& a)
|
| 82 |
: multimap(il, Compare(), a) { }
|
| 83 |
-
~multimap();
|
| 84 |
-
multimap& operator=(const multimap& x);
|
| 85 |
-
multimap& operator=(multimap&& x)
|
| 86 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 87 |
is_nothrow_move_assignable_v<Compare>);
|
| 88 |
-
multimap& operator=(initializer_list<value_type>);
|
| 89 |
-
allocator_type get_allocator() const noexcept;
|
| 90 |
|
| 91 |
// iterators
|
| 92 |
-
iterator begin() noexcept;
|
| 93 |
-
const_iterator begin() const noexcept;
|
| 94 |
-
iterator end() noexcept;
|
| 95 |
-
const_iterator end() const noexcept;
|
| 96 |
|
| 97 |
-
reverse_iterator rbegin() noexcept;
|
| 98 |
-
const_reverse_iterator rbegin() const noexcept;
|
| 99 |
-
reverse_iterator rend() noexcept;
|
| 100 |
-
const_reverse_iterator rend() const noexcept;
|
| 101 |
|
| 102 |
-
const_iterator cbegin() const noexcept;
|
| 103 |
-
const_iterator cend() const noexcept;
|
| 104 |
-
const_reverse_iterator crbegin() const noexcept;
|
| 105 |
-
const_reverse_iterator crend() const noexcept;
|
| 106 |
|
| 107 |
// capacity
|
| 108 |
-
|
| 109 |
-
size_type size() const noexcept;
|
| 110 |
-
size_type max_size() const noexcept;
|
| 111 |
|
| 112 |
// [multimap.modifiers], modifiers
|
| 113 |
-
template<class... Args> iterator emplace(Args&&... args);
|
| 114 |
-
template<class... Args>
|
| 115 |
-
|
| 116 |
-
iterator insert(value_type&
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
iterator insert(const_iterator position, value_type&
|
| 120 |
-
|
|
|
|
| 121 |
template<class InputIterator>
|
| 122 |
-
void insert(InputIterator first, InputIterator last);
|
| 123 |
template<container-compatible-range<value_type> R>
|
| 124 |
-
void insert_range(R&& rg);
|
| 125 |
-
void insert(initializer_list<value_type>);
|
| 126 |
|
| 127 |
-
node_type extract(const_iterator position);
|
| 128 |
-
node_type extract(const key_type& x);
|
| 129 |
template<class K> node_type extract(K&& x);
|
| 130 |
-
iterator insert(node_type&& nh);
|
| 131 |
-
iterator insert(const_iterator hint, node_type&& nh);
|
| 132 |
|
| 133 |
-
iterator erase(iterator position);
|
| 134 |
-
iterator erase(const_iterator position);
|
| 135 |
-
size_type erase(const key_type& x);
|
| 136 |
-
template<class K> size_type erase(K&& x);
|
| 137 |
-
iterator erase(const_iterator first, const_iterator last);
|
| 138 |
-
void swap(multimap&)
|
| 139 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 140 |
is_nothrow_swappable_v<Compare>);
|
| 141 |
-
void clear() noexcept;
|
| 142 |
|
| 143 |
template<class C2>
|
| 144 |
-
void merge(multimap<Key, T, C2, Allocator>& source);
|
| 145 |
template<class C2>
|
| 146 |
-
void merge(multimap<Key, T, C2, Allocator>&& source);
|
| 147 |
template<class C2>
|
| 148 |
-
void merge(map<Key, T, C2, Allocator>& source);
|
| 149 |
template<class C2>
|
| 150 |
-
void merge(map<Key, T, C2, Allocator>&& source);
|
| 151 |
|
| 152 |
// observers
|
| 153 |
-
key_compare key_comp() const;
|
| 154 |
-
value_compare value_comp() const;
|
| 155 |
|
| 156 |
// map operations
|
| 157 |
-
iterator find(const key_type& x);
|
| 158 |
-
const_iterator find(const key_type& x) const;
|
| 159 |
-
template<class K> iterator find(const K& x);
|
| 160 |
-
template<class K> const_iterator find(const K& x) const;
|
| 161 |
|
| 162 |
-
size_type count(const key_type& x) const;
|
| 163 |
-
template<class K> size_type count(const K& x) const;
|
| 164 |
|
| 165 |
-
bool contains(const key_type& x) const;
|
| 166 |
-
template<class K> bool contains(const K& x) const;
|
| 167 |
|
| 168 |
-
iterator lower_bound(const key_type& x);
|
| 169 |
-
const_iterator lower_bound(const key_type& x) const;
|
| 170 |
-
template<class K> iterator lower_bound(const K& x);
|
| 171 |
-
template<class K> const_iterator lower_bound(const K& x) const;
|
| 172 |
|
| 173 |
-
iterator upper_bound(const key_type& x);
|
| 174 |
-
const_iterator upper_bound(const key_type& x) const;
|
| 175 |
-
template<class K> iterator upper_bound(const K& x);
|
| 176 |
-
template<class K> const_iterator upper_bound(const K& x) const;
|
| 177 |
|
| 178 |
-
pair<iterator, iterator> equal_range(const key_type& x);
|
| 179 |
-
pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
|
| 180 |
template<class K>
|
| 181 |
-
pair<iterator, iterator> equal_range(const K& x);
|
| 182 |
template<class K>
|
| 183 |
-
pair<const_iterator, const_iterator> equal_range(const K& x) const;
|
| 184 |
};
|
| 185 |
|
| 186 |
template<class InputIterator, class Compare = less<iter-key-type<InputIterator>>,
|
| 187 |
class Allocator = allocator<iter-to-alloc-type<InputIterator>>>
|
| 188 |
multimap(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator())
|
|
|
|
| 16 |
`Key` and the `value_type` is `pair<const Key,T>`. Descriptions are
|
| 17 |
provided here only for operations on `multimap` that are not described
|
| 18 |
in one of those tables or for operations where there is additional
|
| 19 |
semantic information.
|
| 20 |
|
| 21 |
+
The types `iterator` and `const_iterator` meet the constexpr iterator
|
| 22 |
+
requirements [[iterator.requirements.general]].
|
| 23 |
+
|
| 24 |
``` cpp
|
| 25 |
namespace std {
|
| 26 |
template<class Key, class T, class Compare = less<Key>,
|
| 27 |
class Allocator = allocator<pair<const Key, T>>>
|
| 28 |
class multimap {
|
|
|
|
| 31 |
using key_type = Key;
|
| 32 |
using mapped_type = T;
|
| 33 |
using value_type = pair<const Key, T>;
|
| 34 |
using key_compare = Compare;
|
| 35 |
using allocator_type = Allocator;
|
| 36 |
+
using pointer = allocator_traits<Allocator>::pointer;
|
| 37 |
+
using const_pointer = allocator_traits<Allocator>::const_pointer;
|
| 38 |
using reference = value_type&;
|
| 39 |
using const_reference = const value_type&;
|
| 40 |
using size_type = implementation-defined // type of multimap::size_type; // see [container.requirements]
|
| 41 |
using difference_type = implementation-defined // type of multimap::difference_type; // see [container.requirements]
|
| 42 |
using iterator = implementation-defined // type of multimap::iterator; // see [container.requirements]
|
|
|
|
| 44 |
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 45 |
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 46 |
using node_type = unspecified;
|
| 47 |
|
| 48 |
class value_compare {
|
|
|
|
| 49 |
protected:
|
| 50 |
Compare comp;
|
| 51 |
+
constexpr value_compare(Compare c) : comp(c) { }
|
| 52 |
|
| 53 |
public:
|
| 54 |
+
constexpr bool operator()(const value_type& x, const value_type& y) const {
|
| 55 |
return comp(x.first, y.first);
|
| 56 |
}
|
| 57 |
};
|
| 58 |
|
| 59 |
// [multimap.cons], construct/copy/destroy
|
| 60 |
+
constexpr multimap() : multimap(Compare()) { }
|
| 61 |
+
constexpr explicit multimap(const Compare& comp, const Allocator& = Allocator());
|
| 62 |
template<class InputIterator>
|
| 63 |
+
constexpr multimap(InputIterator first, InputIterator last,
|
| 64 |
+
const Compare& comp = Compare(), const Allocator& = Allocator());
|
|
|
|
| 65 |
template<container-compatible-range<value_type> R>
|
| 66 |
+
constexpr multimap(from_range_t, R&& rg,
|
| 67 |
const Compare& comp = Compare(), const Allocator& = Allocator());
|
| 68 |
+
constexpr multimap(const multimap& x);
|
| 69 |
+
constexpr multimap(multimap&& x);
|
| 70 |
+
constexpr explicit multimap(const Allocator&);
|
| 71 |
+
constexpr multimap(const multimap&, const type_identity_t<Allocator>&);
|
| 72 |
+
constexpr multimap(multimap&&, const type_identity_t<Allocator>&);
|
| 73 |
+
constexpr multimap(initializer_list<value_type>,
|
| 74 |
+
const Compare& = Compare(), const Allocator& = Allocator());
|
|
|
|
| 75 |
template<class InputIterator>
|
| 76 |
+
constexpr multimap(InputIterator first, InputIterator last, const Allocator& a)
|
| 77 |
: multimap(first, last, Compare(), a) { }
|
| 78 |
template<container-compatible-range<value_type> R>
|
| 79 |
+
constexpr multimap(from_range_t, R&& rg, const Allocator& a)
|
| 80 |
: multimap(from_range, std::forward<R>(rg), Compare(), a) { }
|
| 81 |
+
constexpr multimap(initializer_list<value_type> il, const Allocator& a)
|
| 82 |
: multimap(il, Compare(), a) { }
|
| 83 |
+
constexpr ~multimap();
|
| 84 |
+
constexpr multimap& operator=(const multimap& x);
|
| 85 |
+
constexpr multimap& operator=(multimap&& x)
|
| 86 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 87 |
is_nothrow_move_assignable_v<Compare>);
|
| 88 |
+
constexpr multimap& operator=(initializer_list<value_type>);
|
| 89 |
+
constexpr allocator_type get_allocator() const noexcept;
|
| 90 |
|
| 91 |
// iterators
|
| 92 |
+
constexpr iterator begin() noexcept;
|
| 93 |
+
constexpr const_iterator begin() const noexcept;
|
| 94 |
+
constexpr iterator end() noexcept;
|
| 95 |
+
constexpr const_iterator end() const noexcept;
|
| 96 |
|
| 97 |
+
constexpr reverse_iterator rbegin() noexcept;
|
| 98 |
+
constexpr const_reverse_iterator rbegin() const noexcept;
|
| 99 |
+
constexpr reverse_iterator rend() noexcept;
|
| 100 |
+
constexpr const_reverse_iterator rend() const noexcept;
|
| 101 |
|
| 102 |
+
constexpr const_iterator cbegin() const noexcept;
|
| 103 |
+
constexpr const_iterator cend() const noexcept;
|
| 104 |
+
constexpr const_reverse_iterator crbegin() const noexcept;
|
| 105 |
+
constexpr const_reverse_iterator crend() const noexcept;
|
| 106 |
|
| 107 |
// capacity
|
| 108 |
+
constexpr bool empty() const noexcept;
|
| 109 |
+
constexpr size_type size() const noexcept;
|
| 110 |
+
constexpr size_type max_size() const noexcept;
|
| 111 |
|
| 112 |
// [multimap.modifiers], modifiers
|
| 113 |
+
template<class... Args> constexpr iterator emplace(Args&&... args);
|
| 114 |
+
template<class... Args>
|
| 115 |
+
constexpr iterator emplace_hint(const_iterator position, Args&&... args);
|
| 116 |
+
constexpr iterator insert(const value_type& x);
|
| 117 |
+
constexpr iterator insert(value_type&& x);
|
| 118 |
+
template<class P> constexpr iterator insert(P&& x);
|
| 119 |
+
constexpr iterator insert(const_iterator position, const value_type& x);
|
| 120 |
+
constexpr iterator insert(const_iterator position, value_type&& x);
|
| 121 |
+
template<class P> constexpr iterator insert(const_iterator position, P&& x);
|
| 122 |
template<class InputIterator>
|
| 123 |
+
constexpr void insert(InputIterator first, InputIterator last);
|
| 124 |
template<container-compatible-range<value_type> R>
|
| 125 |
+
constexpr void insert_range(R&& rg);
|
| 126 |
+
constexpr void insert(initializer_list<value_type>);
|
| 127 |
|
| 128 |
+
constexpr node_type extract(const_iterator position);
|
| 129 |
+
constexpr node_type extract(const key_type& x);
|
| 130 |
template<class K> node_type extract(K&& x);
|
| 131 |
+
constexpr iterator insert(node_type&& nh);
|
| 132 |
+
constexpr iterator insert(const_iterator hint, node_type&& nh);
|
| 133 |
|
| 134 |
+
constexpr iterator erase(iterator position);
|
| 135 |
+
constexpr iterator erase(const_iterator position);
|
| 136 |
+
constexpr size_type erase(const key_type& x);
|
| 137 |
+
template<class K> constexpr size_type erase(K&& x);
|
| 138 |
+
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 139 |
+
constexpr void swap(multimap&)
|
| 140 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 141 |
is_nothrow_swappable_v<Compare>);
|
| 142 |
+
constexpr void clear() noexcept;
|
| 143 |
|
| 144 |
template<class C2>
|
| 145 |
+
constexpr void merge(multimap<Key, T, C2, Allocator>& source);
|
| 146 |
template<class C2>
|
| 147 |
+
constexpr void merge(multimap<Key, T, C2, Allocator>&& source);
|
| 148 |
template<class C2>
|
| 149 |
+
constexpr void merge(map<Key, T, C2, Allocator>& source);
|
| 150 |
template<class C2>
|
| 151 |
+
constexpr void merge(map<Key, T, C2, Allocator>&& source);
|
| 152 |
|
| 153 |
// observers
|
| 154 |
+
constexpr key_compare key_comp() const;
|
| 155 |
+
constexpr value_compare value_comp() const;
|
| 156 |
|
| 157 |
// map operations
|
| 158 |
+
constexpr iterator find(const key_type& x);
|
| 159 |
+
constexpr const_iterator find(const key_type& x) const;
|
| 160 |
+
template<class K> constexpr iterator find(const K& x);
|
| 161 |
+
template<class K> constexpr const_iterator find(const K& x) const;
|
| 162 |
|
| 163 |
+
constexpr size_type count(const key_type& x) const;
|
| 164 |
+
template<class K> constexpr size_type count(const K& x) const;
|
| 165 |
|
| 166 |
+
constexpr bool contains(const key_type& x) const;
|
| 167 |
+
template<class K> constexpr bool contains(const K& x) const;
|
| 168 |
|
| 169 |
+
constexpr iterator lower_bound(const key_type& x);
|
| 170 |
+
constexpr const_iterator lower_bound(const key_type& x) const;
|
| 171 |
+
template<class K> constexpr iterator lower_bound(const K& x);
|
| 172 |
+
template<class K> constexpr const_iterator lower_bound(const K& x) const;
|
| 173 |
|
| 174 |
+
constexpr iterator upper_bound(const key_type& x);
|
| 175 |
+
constexpr const_iterator upper_bound(const key_type& x) const;
|
| 176 |
+
template<class K> constexpr iterator upper_bound(const K& x);
|
| 177 |
+
template<class K> constexpr const_iterator upper_bound(const K& x) const;
|
| 178 |
|
| 179 |
+
constexpr pair<iterator, iterator> equal_range(const key_type& x);
|
| 180 |
+
constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
|
| 181 |
template<class K>
|
| 182 |
+
constexpr pair<iterator, iterator> equal_range(const K& x);
|
| 183 |
template<class K>
|
| 184 |
+
constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
|
| 185 |
};
|
| 186 |
|
| 187 |
template<class InputIterator, class Compare = less<iter-key-type<InputIterator>>,
|
| 188 |
class Allocator = allocator<iter-to-alloc-type<InputIterator>>>
|
| 189 |
multimap(InputIterator, InputIterator, Compare = Compare(), Allocator = Allocator())
|