tmp/tmpvh2z3z3u/{from.md → to.md}
RENAMED
|
@@ -6,20 +6,23 @@ provides for fast retrieval of the keys themselves. The `multiset` class
|
|
| 6 |
supports bidirectional iterators.
|
| 7 |
|
| 8 |
A `multiset` meets all of the requirements of a container
|
| 9 |
[[container.reqmts]], of a reversible container
|
| 10 |
[[container.rev.reqmts]], of an allocator-aware container
|
| 11 |
-
[[container.alloc.reqmts]], of an associative container
|
| 12 |
[[associative.reqmts]]. `multiset` also provides most operations
|
| 13 |
described in [[associative.reqmts]] for duplicate keys. This means that
|
| 14 |
a `multiset` supports the `a_eq` operations in [[associative.reqmts]]
|
| 15 |
but not the `a_uniq` operations. For a `multiset<Key>` both the
|
| 16 |
`key_type` and `value_type` are `Key`. Descriptions are provided here
|
| 17 |
only for operations on `multiset` that are not described in one of these
|
| 18 |
tables and for operations where there is additional semantic
|
| 19 |
information.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
``` cpp
|
| 22 |
namespace std {
|
| 23 |
template<class Key, class Compare = less<Key>,
|
| 24 |
class Allocator = allocator<Key>>
|
| 25 |
class multiset {
|
|
@@ -28,12 +31,12 @@ namespace std {
|
|
| 28 |
using key_type = Key;
|
| 29 |
using key_compare = Compare;
|
| 30 |
using value_type = Key;
|
| 31 |
using value_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 multiset::size_type; // see [container.requirements]
|
| 38 |
using difference_type = implementation-defined // type of multiset::difference_type; // see [container.requirements]
|
| 39 |
using iterator = implementation-defined // type of multiset::iterator; // see [container.requirements]
|
|
@@ -41,133 +44,134 @@ 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 |
// [multiset.cons], construct/copy/destroy
|
| 46 |
-
multiset() : multiset(Compare()) { }
|
| 47 |
-
explicit multiset(const Compare& comp, const Allocator& = Allocator());
|
| 48 |
template<class InputIterator>
|
| 49 |
-
multiset(InputIterator first, InputIterator last,
|
| 50 |
const Compare& comp = Compare(), const Allocator& = Allocator());
|
| 51 |
template<container-compatible-range<value_type> R>
|
| 52 |
-
multiset(from_range_t, R&& rg,
|
| 53 |
const Compare& comp = Compare(), const Allocator& = Allocator());
|
| 54 |
-
multiset(const multiset& x);
|
| 55 |
-
multiset(multiset&& x);
|
| 56 |
-
explicit multiset(const Allocator&);
|
| 57 |
-
multiset(const multiset&, const type_identity_t<Allocator>&);
|
| 58 |
-
multiset(multiset&&, const type_identity_t<Allocator>&);
|
| 59 |
-
multiset(initializer_list<value_type>, const Compare& = Compare(),
|
| 60 |
const Allocator& = Allocator());
|
| 61 |
template<class InputIterator>
|
| 62 |
-
multiset(InputIterator first, InputIterator last, const Allocator& a)
|
| 63 |
: multiset(first, last, Compare(), a) { }
|
| 64 |
template<container-compatible-range<value_type> R>
|
| 65 |
-
multiset(from_range_t, R&& rg, const Allocator& a)
|
| 66 |
: multiset(from_range, std::forward<R>(rg), Compare(), a) { }
|
| 67 |
-
multiset(initializer_list<value_type> il, const Allocator& a)
|
| 68 |
: multiset(il, Compare(), a) { }
|
| 69 |
-
~multiset();
|
| 70 |
-
multiset& operator=(const multiset& x);
|
| 71 |
-
multiset& operator=(multiset&& x)
|
| 72 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 73 |
is_nothrow_move_assignable_v<Compare>);
|
| 74 |
-
multiset& operator=(initializer_list<value_type>);
|
| 75 |
-
allocator_type get_allocator() const noexcept;
|
| 76 |
|
| 77 |
// iterators
|
| 78 |
-
iterator begin() noexcept;
|
| 79 |
-
const_iterator begin() const noexcept;
|
| 80 |
-
iterator end() noexcept;
|
| 81 |
-
const_iterator end() const noexcept;
|
| 82 |
|
| 83 |
-
reverse_iterator rbegin() noexcept;
|
| 84 |
-
const_reverse_iterator rbegin() const noexcept;
|
| 85 |
-
reverse_iterator rend() noexcept;
|
| 86 |
-
const_reverse_iterator rend() const noexcept;
|
| 87 |
|
| 88 |
-
const_iterator cbegin() const noexcept;
|
| 89 |
-
const_iterator cend() const noexcept;
|
| 90 |
-
const_reverse_iterator crbegin() const noexcept;
|
| 91 |
-
const_reverse_iterator crend() const noexcept;
|
| 92 |
|
| 93 |
// capacity
|
| 94 |
-
|
| 95 |
-
size_type size() const noexcept;
|
| 96 |
-
size_type max_size() const noexcept;
|
| 97 |
|
| 98 |
// modifiers
|
| 99 |
-
template<class... Args> iterator emplace(Args&&... args);
|
| 100 |
-
template<class... Args>
|
| 101 |
-
|
| 102 |
-
iterator insert(value_type&
|
| 103 |
-
iterator insert(
|
| 104 |
-
iterator insert(const_iterator position, value_type&
|
|
|
|
| 105 |
template<class InputIterator>
|
| 106 |
-
void insert(InputIterator first, InputIterator last);
|
| 107 |
template<container-compatible-range<value_type> R>
|
| 108 |
-
void insert_range(R&& rg);
|
| 109 |
-
void insert(initializer_list<value_type>);
|
| 110 |
|
| 111 |
-
node_type extract(const_iterator position);
|
| 112 |
-
node_type extract(const key_type& x);
|
| 113 |
-
template<class K> node_type extract(K&& x);
|
| 114 |
-
iterator insert(node_type&& nh);
|
| 115 |
-
iterator insert(const_iterator hint, node_type&& nh);
|
| 116 |
|
| 117 |
-
iterator erase(iterator position)
|
| 118 |
requires (!same_as<iterator, const_iterator>);
|
| 119 |
-
iterator erase(const_iterator position);
|
| 120 |
-
size_type erase(const key_type& x);
|
| 121 |
-
template<class K> size_type erase(K&& x);
|
| 122 |
-
iterator erase(const_iterator first, const_iterator last);
|
| 123 |
-
void swap(multiset&)
|
| 124 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 125 |
is_nothrow_swappable_v<Compare>);
|
| 126 |
-
void clear() noexcept;
|
| 127 |
|
| 128 |
template<class C2>
|
| 129 |
-
void merge(multiset<Key, C2, Allocator>& source);
|
| 130 |
template<class C2>
|
| 131 |
-
void merge(multiset<Key, C2, Allocator>&& source);
|
| 132 |
template<class C2>
|
| 133 |
-
void merge(set<Key, C2, Allocator>& source);
|
| 134 |
template<class C2>
|
| 135 |
-
void merge(set<Key, C2, Allocator>&& source);
|
| 136 |
|
| 137 |
// observers
|
| 138 |
-
key_compare key_comp() const;
|
| 139 |
-
value_compare value_comp() const;
|
| 140 |
|
| 141 |
// set operations
|
| 142 |
-
iterator find(const key_type& x);
|
| 143 |
-
const_iterator find(const key_type& x) const;
|
| 144 |
-
template<class K> iterator find(const K& x);
|
| 145 |
-
template<class K> const_iterator find(const K& x) const;
|
| 146 |
|
| 147 |
-
size_type count(const key_type& x) const;
|
| 148 |
-
template<class K> size_type count(const K& x) const;
|
| 149 |
|
| 150 |
-
bool contains(const key_type& x) const;
|
| 151 |
-
template<class K> bool contains(const K& x) const;
|
| 152 |
|
| 153 |
-
iterator lower_bound(const key_type& x);
|
| 154 |
-
const_iterator lower_bound(const key_type& x) const;
|
| 155 |
-
template<class K> iterator lower_bound(const K& x);
|
| 156 |
-
template<class K> const_iterator lower_bound(const K& x) const;
|
| 157 |
|
| 158 |
-
iterator upper_bound(const key_type& x);
|
| 159 |
-
const_iterator upper_bound(const key_type& x) const;
|
| 160 |
-
template<class K> iterator upper_bound(const K& x);
|
| 161 |
-
template<class K> const_iterator upper_bound(const K& x) const;
|
| 162 |
|
| 163 |
-
pair<iterator, iterator> equal_range(const key_type& x);
|
| 164 |
-
pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
|
| 165 |
template<class K>
|
| 166 |
-
pair<iterator, iterator> equal_range(const K& x);
|
| 167 |
template<class K>
|
| 168 |
-
pair<const_iterator, const_iterator> equal_range(const K& x) const;
|
| 169 |
};
|
| 170 |
|
| 171 |
template<class InputIterator,
|
| 172 |
class Compare = less<iter-value-type<InputIterator>>,
|
| 173 |
class Allocator = allocator<iter-value-type<InputIterator>>>
|
|
|
|
| 6 |
supports bidirectional iterators.
|
| 7 |
|
| 8 |
A `multiset` meets all of the requirements of a container
|
| 9 |
[[container.reqmts]], of a reversible container
|
| 10 |
[[container.rev.reqmts]], of an allocator-aware container
|
| 11 |
+
[[container.alloc.reqmts]], and of an associative container
|
| 12 |
[[associative.reqmts]]. `multiset` also provides most operations
|
| 13 |
described in [[associative.reqmts]] for duplicate keys. This means that
|
| 14 |
a `multiset` supports the `a_eq` operations in [[associative.reqmts]]
|
| 15 |
but not the `a_uniq` operations. For a `multiset<Key>` both the
|
| 16 |
`key_type` and `value_type` are `Key`. Descriptions are provided here
|
| 17 |
only for operations on `multiset` that are not described in one of these
|
| 18 |
tables and for operations where there is additional semantic
|
| 19 |
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 Compare = less<Key>,
|
| 27 |
class Allocator = allocator<Key>>
|
| 28 |
class multiset {
|
|
|
|
| 31 |
using key_type = Key;
|
| 32 |
using key_compare = Compare;
|
| 33 |
using value_type = Key;
|
| 34 |
using value_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 multiset::size_type; // see [container.requirements]
|
| 41 |
using difference_type = implementation-defined // type of multiset::difference_type; // see [container.requirements]
|
| 42 |
using iterator = implementation-defined // type of multiset::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 |
// [multiset.cons], construct/copy/destroy
|
| 49 |
+
constexpr multiset() : multiset(Compare()) { }
|
| 50 |
+
constexpr explicit multiset(const Compare& comp, const Allocator& = Allocator());
|
| 51 |
template<class InputIterator>
|
| 52 |
+
constexpr multiset(InputIterator first, InputIterator last,
|
| 53 |
const Compare& comp = Compare(), const Allocator& = Allocator());
|
| 54 |
template<container-compatible-range<value_type> R>
|
| 55 |
+
constexpr multiset(from_range_t, R&& rg,
|
| 56 |
const Compare& comp = Compare(), const Allocator& = Allocator());
|
| 57 |
+
constexpr multiset(const multiset& x);
|
| 58 |
+
constexpr multiset(multiset&& x);
|
| 59 |
+
constexpr explicit multiset(const Allocator&);
|
| 60 |
+
constexpr multiset(const multiset&, const type_identity_t<Allocator>&);
|
| 61 |
+
constexpr multiset(multiset&&, const type_identity_t<Allocator>&);
|
| 62 |
+
constexpr multiset(initializer_list<value_type>, const Compare& = Compare(),
|
| 63 |
const Allocator& = Allocator());
|
| 64 |
template<class InputIterator>
|
| 65 |
+
constexpr multiset(InputIterator first, InputIterator last, const Allocator& a)
|
| 66 |
: multiset(first, last, Compare(), a) { }
|
| 67 |
template<container-compatible-range<value_type> R>
|
| 68 |
+
constexpr multiset(from_range_t, R&& rg, const Allocator& a)
|
| 69 |
: multiset(from_range, std::forward<R>(rg), Compare(), a) { }
|
| 70 |
+
constexpr multiset(initializer_list<value_type> il, const Allocator& a)
|
| 71 |
: multiset(il, Compare(), a) { }
|
| 72 |
+
constexpr ~multiset();
|
| 73 |
+
constexpr multiset& operator=(const multiset& x);
|
| 74 |
+
constexpr multiset& operator=(multiset&& x)
|
| 75 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 76 |
is_nothrow_move_assignable_v<Compare>);
|
| 77 |
+
constexpr multiset& operator=(initializer_list<value_type>);
|
| 78 |
+
constexpr allocator_type get_allocator() const noexcept;
|
| 79 |
|
| 80 |
// iterators
|
| 81 |
+
constexpr iterator begin() noexcept;
|
| 82 |
+
constexpr const_iterator begin() const noexcept;
|
| 83 |
+
constexpr iterator end() noexcept;
|
| 84 |
+
constexpr const_iterator end() const noexcept;
|
| 85 |
|
| 86 |
+
constexpr reverse_iterator rbegin() noexcept;
|
| 87 |
+
constexpr const_reverse_iterator rbegin() const noexcept;
|
| 88 |
+
constexpr reverse_iterator rend() noexcept;
|
| 89 |
+
constexpr const_reverse_iterator rend() const noexcept;
|
| 90 |
|
| 91 |
+
constexpr const_iterator cbegin() const noexcept;
|
| 92 |
+
constexpr const_iterator cend() const noexcept;
|
| 93 |
+
constexpr const_reverse_iterator crbegin() const noexcept;
|
| 94 |
+
constexpr const_reverse_iterator crend() const noexcept;
|
| 95 |
|
| 96 |
// capacity
|
| 97 |
+
constexpr bool empty() const noexcept;
|
| 98 |
+
constexpr size_type size() const noexcept;
|
| 99 |
+
constexpr size_type max_size() const noexcept;
|
| 100 |
|
| 101 |
// modifiers
|
| 102 |
+
template<class... Args> constexpr iterator emplace(Args&&... args);
|
| 103 |
+
template<class... Args>
|
| 104 |
+
constexpr iterator emplace_hint(const_iterator position, Args&&... args);
|
| 105 |
+
constexpr iterator insert(const value_type& x);
|
| 106 |
+
constexpr iterator insert(value_type&& x);
|
| 107 |
+
constexpr iterator insert(const_iterator position, const value_type& x);
|
| 108 |
+
constexpr iterator insert(const_iterator position, value_type&& x);
|
| 109 |
template<class InputIterator>
|
| 110 |
+
constexpr void insert(InputIterator first, InputIterator last);
|
| 111 |
template<container-compatible-range<value_type> R>
|
| 112 |
+
constexpr void insert_range(R&& rg);
|
| 113 |
+
constexpr void insert(initializer_list<value_type>);
|
| 114 |
|
| 115 |
+
constexpr node_type extract(const_iterator position);
|
| 116 |
+
constexpr node_type extract(const key_type& x);
|
| 117 |
+
template<class K> constexpr node_type extract(K&& x);
|
| 118 |
+
constexpr iterator insert(node_type&& nh);
|
| 119 |
+
constexpr iterator insert(const_iterator hint, node_type&& nh);
|
| 120 |
|
| 121 |
+
constexpr iterator erase(iterator position)
|
| 122 |
requires (!same_as<iterator, const_iterator>);
|
| 123 |
+
constexpr iterator erase(const_iterator position);
|
| 124 |
+
constexpr size_type erase(const key_type& x);
|
| 125 |
+
template<class K> constexpr size_type erase(K&& x);
|
| 126 |
+
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 127 |
+
constexpr void swap(multiset&)
|
| 128 |
noexcept(allocator_traits<Allocator>::is_always_equal::value &&
|
| 129 |
is_nothrow_swappable_v<Compare>);
|
| 130 |
+
constexpr void clear() noexcept;
|
| 131 |
|
| 132 |
template<class C2>
|
| 133 |
+
constexpr void merge(multiset<Key, C2, Allocator>& source);
|
| 134 |
template<class C2>
|
| 135 |
+
constexpr void merge(multiset<Key, C2, Allocator>&& source);
|
| 136 |
template<class C2>
|
| 137 |
+
constexpr void merge(set<Key, C2, Allocator>& source);
|
| 138 |
template<class C2>
|
| 139 |
+
constexpr void merge(set<Key, C2, Allocator>&& source);
|
| 140 |
|
| 141 |
// observers
|
| 142 |
+
constexpr key_compare key_comp() const;
|
| 143 |
+
constexpr value_compare value_comp() const;
|
| 144 |
|
| 145 |
// set operations
|
| 146 |
+
constexpr iterator find(const key_type& x);
|
| 147 |
+
constexpr const_iterator find(const key_type& x) const;
|
| 148 |
+
template<class K> constexpr iterator find(const K& x);
|
| 149 |
+
template<class K> constexpr const_iterator find(const K& x) const;
|
| 150 |
|
| 151 |
+
constexpr size_type count(const key_type& x) const;
|
| 152 |
+
template<class K> constexpr size_type count(const K& x) const;
|
| 153 |
|
| 154 |
+
constexpr bool contains(const key_type& x) const;
|
| 155 |
+
template<class K> constexpr bool contains(const K& x) const;
|
| 156 |
|
| 157 |
+
constexpr iterator lower_bound(const key_type& x);
|
| 158 |
+
constexpr const_iterator lower_bound(const key_type& x) const;
|
| 159 |
+
template<class K> constexpr iterator lower_bound(const K& x);
|
| 160 |
+
template<class K> constexpr const_iterator lower_bound(const K& x) const;
|
| 161 |
|
| 162 |
+
constexpr iterator upper_bound(const key_type& x);
|
| 163 |
+
constexpr const_iterator upper_bound(const key_type& x) const;
|
| 164 |
+
template<class K> constexpr iterator upper_bound(const K& x);
|
| 165 |
+
template<class K> constexpr const_iterator upper_bound(const K& x) const;
|
| 166 |
|
| 167 |
+
constexpr pair<iterator, iterator> equal_range(const key_type& x);
|
| 168 |
+
constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
|
| 169 |
template<class K>
|
| 170 |
+
constexpr pair<iterator, iterator> equal_range(const K& x);
|
| 171 |
template<class K>
|
| 172 |
+
constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
|
| 173 |
};
|
| 174 |
|
| 175 |
template<class InputIterator,
|
| 176 |
class Compare = less<iter-value-type<InputIterator>>,
|
| 177 |
class Allocator = allocator<iter-value-type<InputIterator>>>
|