From Jason Turner

[multiset.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp98z3xyau/{from.md → to.md} +33 -18
tmp/tmp98z3xyau/{from.md → to.md} RENAMED
@@ -1,16 +1,17 @@
1
  #### Overview <a id="multiset.overview">[[multiset.overview]]</a>
2
 
3
  A `multiset` is an associative container that supports equivalent keys
4
- (possibly contains multiple copies of the same key value) and provides
5
- for fast retrieval of the keys themselves. The `multiset` class supports
6
- bidirectional iterators.
7
 
8
- A `multiset` meets all of the requirements of a container, of a
9
- reversible container [[container.requirements]], of an associative
10
- container [[associative.reqmts]], and of an allocator-aware container (
11
- [[container.alloc.req]]). `multiset` also provides most operations
 
12
  described in  [[associative.reqmts]] for duplicate keys. This means that
13
  a `multiset` supports the `a_eq` operations in  [[associative.reqmts]]
14
  but not the `a_uniq` operations. For a `multiset<Key>` both the
15
  `key_type` and `value_type` are `Key`. Descriptions are provided here
16
  only for operations on `multiset` that are not described in one of these
@@ -31,12 +32,12 @@ namespace std {
31
  using allocator_type = Allocator;
32
  using pointer = typename allocator_traits<Allocator>::pointer;
33
  using const_pointer = typename allocator_traits<Allocator>::const_pointer;
34
  using reference = value_type&;
35
  using const_reference = const value_type&;
36
- using size_type = implementation-defined; // see [container.requirements]
37
- using difference_type = implementation-defined; // see [container.requirements]
38
  using iterator = implementation-defined // type of multiset::iterator; // see [container.requirements]
39
  using const_iterator = implementation-defined // type of multiset::const_iterator; // see [container.requirements]
40
  using reverse_iterator = std::reverse_iterator<iterator>;
41
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
42
  using node_type = unspecified;
@@ -45,20 +46,26 @@ namespace std {
45
  multiset() : multiset(Compare()) { }
46
  explicit multiset(const Compare& comp, const Allocator& = Allocator());
47
  template<class InputIterator>
48
  multiset(InputIterator first, InputIterator last,
49
  const Compare& comp = Compare(), const Allocator& = Allocator());
 
 
 
50
  multiset(const multiset& x);
51
  multiset(multiset&& x);
52
  explicit multiset(const Allocator&);
53
- multiset(const multiset&, const Allocator&);
54
- multiset(multiset&&, const Allocator&);
55
  multiset(initializer_list<value_type>, const Compare& = Compare(),
56
  const Allocator& = Allocator());
57
  template<class InputIterator>
58
  multiset(InputIterator first, InputIterator last, const Allocator& a)
59
  : multiset(first, last, Compare(), a) { }
 
 
 
60
  multiset(initializer_list<value_type> il, const Allocator& a)
61
  : multiset(il, Compare(), a) { }
62
  ~multiset();
63
  multiset& operator=(const multiset& x);
64
  multiset& operator=(multiset&& x)
@@ -95,20 +102,25 @@ namespace std {
95
  iterator insert(value_type&& x);
96
  iterator insert(const_iterator position, const value_type& x);
97
  iterator insert(const_iterator position, value_type&& x);
98
  template<class InputIterator>
99
  void insert(InputIterator first, InputIterator last);
 
 
100
  void insert(initializer_list<value_type>);
101
 
102
  node_type extract(const_iterator position);
103
  node_type extract(const key_type& x);
 
104
  iterator insert(node_type&& nh);
105
  iterator insert(const_iterator hint, node_type&& nh);
106
 
107
- iterator erase(iterator position);
 
108
  iterator erase(const_iterator position);
109
  size_type erase(const key_type& x);
 
110
  iterator erase(const_iterator first, const_iterator last);
111
  void swap(multiset&)
112
  noexcept(allocator_traits<Allocator>::is_always_equal::value &&
113
  is_nothrow_swappable_v<Compare>);
114
  void clear() noexcept;
@@ -161,25 +173,28 @@ namespace std {
161
  class Allocator = allocator<iter-value-type<InputIterator>>>
162
  multiset(InputIterator, InputIterator,
163
  Compare = Compare(), Allocator = Allocator())
164
  -> multiset<iter-value-type<InputIterator>, Compare, Allocator>;
165
 
 
 
 
 
 
166
  template<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>
167
  multiset(initializer_list<Key>, Compare = Compare(), Allocator = Allocator())
168
  -> multiset<Key, Compare, Allocator>;
169
 
170
  template<class InputIterator, class Allocator>
171
  multiset(InputIterator, InputIterator, Allocator)
172
  -> multiset<iter-value-type<InputIterator>,
173
  less<iter-value-type<InputIterator>>, Allocator>;
174
 
 
 
 
 
175
  template<class Key, class Allocator>
176
  multiset(initializer_list<Key>, Allocator) -> multiset<Key, less<Key>, Allocator>;
177
-
178
- // swap
179
- template<class Key, class Compare, class Allocator>
180
- void swap(multiset<Key, Compare, Allocator>& x,
181
- multiset<Key, Compare, Allocator>& y)
182
- noexcept(noexcept(x.swap(y)));
183
  }
184
  ```
185
 
 
1
  #### Overview <a id="multiset.overview">[[multiset.overview]]</a>
2
 
3
  A `multiset` is an associative container that supports equivalent keys
4
+ (i.e., possibly contains multiple copies of the same key value) and
5
+ 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
 
32
  using allocator_type = Allocator;
33
  using pointer = typename allocator_traits<Allocator>::pointer;
34
  using const_pointer = typename allocator_traits<Allocator>::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]
40
  using const_iterator = implementation-defined // type of multiset::const_iterator; // see [container.requirements]
41
  using reverse_iterator = std::reverse_iterator<iterator>;
42
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
43
  using node_type = unspecified;
 
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)
 
102
  iterator insert(value_type&& x);
103
  iterator insert(const_iterator position, const value_type& x);
104
  iterator insert(const_iterator position, value_type&& x);
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;
 
173
  class Allocator = allocator<iter-value-type<InputIterator>>>
174
  multiset(InputIterator, InputIterator,
175
  Compare = Compare(), Allocator = Allocator())
176
  -> multiset<iter-value-type<InputIterator>, Compare, Allocator>;
177
 
178
+ template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
179
+ class Allocator = allocator<ranges::range_value_t<R>>>
180
+ multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
181
+ -> multiset<ranges::range_value_t<R>, Compare, Allocator>;
182
+
183
  template<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>
184
  multiset(initializer_list<Key>, Compare = Compare(), Allocator = Allocator())
185
  -> multiset<Key, Compare, Allocator>;
186
 
187
  template<class InputIterator, class Allocator>
188
  multiset(InputIterator, InputIterator, Allocator)
189
  -> multiset<iter-value-type<InputIterator>,
190
  less<iter-value-type<InputIterator>>, Allocator>;
191
 
192
+ template<ranges::input_range R, class Allocator>
193
+ multiset(from_range_t, R&&, Allocator)
194
+ -> multiset<ranges::range_value_t<R>, less<ranges::range_value_t<R>>, Allocator>;
195
+
196
  template<class Key, class Allocator>
197
  multiset(initializer_list<Key>, Allocator) -> multiset<Key, less<Key>, Allocator>;
 
 
 
 
 
 
198
  }
199
  ```
200