From Jason Turner

[multiset.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpvjcgm1d4/{from.md → to.md} +66 -29
tmp/tmpvjcgm1d4/{from.md → to.md} RENAMED
@@ -7,13 +7,13 @@ bidirectional iterators.
7
 
8
  A `multiset` satisfies 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
  (Table  [[tab:containers.allocatoraware]]). `multiset` also provides
12
- most operations described in ([[associative.reqmts]]) for duplicate
13
- keys. This means that a `multiset` supports the `a_eq` operations in (
14
- [[associative.reqmts]]) but not the `a_uniq` operations. For a
15
  `multiset<Key>` both the `key_type` and `value_type` are `Key`.
16
  Descriptions are provided here only for operations on `multiset` that
17
  are not described in one of these tables and for operations where there
18
  is additional semantic information.
19
 
@@ -22,50 +22,50 @@ namespace std {
22
  template <class Key, class Compare = less<Key>,
23
  class Allocator = allocator<Key>>
24
  class multiset {
25
  public:
26
  // types:
27
- typedef Key key_type;
28
- typedef Key value_type;
29
- typedef Compare key_compare;
30
- typedef Compare value_compare;
31
- typedef Allocator allocator_type;
32
- typedef value_type& reference;
33
- typedef const value_type& const_reference;
34
- typedef implementation-defined iterator; // see [container.requirements]
35
- typedef implementation-defined const_iterator; // see [container.requirements]
36
- typedef implementation-defined size_type; // see [container.requirements]
37
- typedef implementation-defined difference_type;// see [container.requirements]
38
- typedef typename allocator_traits<Allocator>::pointer pointer;
39
- typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
40
- typedef std::reverse_iterator<iterator> reverse_iterator;
41
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
 
42
 
43
- // construct/copy/destroy:
44
  multiset() : multiset(Compare()) { }
45
- explicit multiset(const Compare& comp,
46
- const Allocator& = Allocator());
47
  template <class InputIterator>
48
  multiset(InputIterator first, InputIterator last,
49
- const Compare& comp = Compare(),
50
- const Allocator& = Allocator());
51
  multiset(const multiset& x);
52
  multiset(multiset&& x);
53
  explicit multiset(const Allocator&);
54
  multiset(const multiset&, const Allocator&);
55
  multiset(multiset&&, const Allocator&);
56
- multiset(initializer_list<value_type>,
57
- const Compare& = Compare(),
58
  const Allocator& = Allocator());
59
  template <class InputIterator>
60
  multiset(InputIterator first, InputIterator last, const Allocator& a)
61
  : multiset(first, last, Compare(), a) { }
62
  multiset(initializer_list<value_type> il, const Allocator& a)
63
  : multiset(il, Compare(), a) { }
64
  ~multiset();
65
  multiset& operator=(const multiset& x);
66
- multiset& operator=(multiset&& x);
 
 
67
  multiset& operator=(initializer_list<value_type>);
68
  allocator_type get_allocator() const noexcept;
69
 
70
  // iterators:
71
  iterator begin() noexcept;
@@ -97,16 +97,33 @@ namespace std {
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
  iterator erase(const_iterator position);
103
  size_type erase(const key_type& x);
104
  iterator erase(const_iterator first, const_iterator last);
105
- void swap(multiset&);
 
 
106
  void clear() noexcept;
107
 
 
 
 
 
 
 
 
 
 
108
  // observers:
109
  key_compare key_comp() const;
110
  value_compare value_comp() const;
111
 
112
  // set operations:
@@ -134,10 +151,29 @@ namespace std {
134
  pair<iterator, iterator> equal_range(const K& x);
135
  template <class K>
136
  pair<const_iterator, const_iterator> equal_range(const K& x) const;
137
  };
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  template <class Key, class Compare, class Allocator>
140
  bool operator==(const multiset<Key, Compare, Allocator>& x,
141
  const multiset<Key, Compare, Allocator>& y);
142
  template <class Key, class Compare, class Allocator>
143
  bool operator< (const multiset<Key, Compare, Allocator>& x,
@@ -153,12 +189,13 @@ namespace std {
153
  const multiset<Key, Compare, Allocator>& y);
154
  template <class Key, class Compare, class Allocator>
155
  bool operator<=(const multiset<Key, Compare, Allocator>& x,
156
  const multiset<Key, Compare, Allocator>& y);
157
 
158
- // specialized algorithms:
159
  template <class Key, class Compare, class Allocator>
160
  void swap(multiset<Key, Compare, Allocator>& x,
161
- multiset<Key,Compare,Allocator>& y);
 
162
  }
163
  ```
164
 
 
7
 
8
  A `multiset` satisfies 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
  (Table  [[tab:containers.allocatoraware]]). `multiset` also provides
12
+ most operations described in  [[associative.reqmts]] for duplicate keys.
13
+ This means that a `multiset` supports the `a_eq` operations in 
14
+ [[associative.reqmts]] but not the `a_uniq` operations. For a
15
  `multiset<Key>` both the `key_type` and `value_type` are `Key`.
16
  Descriptions are provided here only for operations on `multiset` that
17
  are not described in one of these tables and for operations where there
18
  is additional semantic information.
19
 
 
22
  template <class Key, class Compare = less<Key>,
23
  class Allocator = allocator<Key>>
24
  class multiset {
25
  public:
26
  // types:
27
+ using key_type = Key;
28
+ using key_compare = Compare;
29
+ using value_type = Key;
30
+ using value_compare = Compare;
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;
43
 
44
+ // [multiset.cons], construct/copy/destroy
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)
65
+ noexcept(allocator_traits<Allocator>::is_always_equal::value &&
66
+ is_nothrow_move_assignable_v<Compare>);
67
  multiset& operator=(initializer_list<value_type>);
68
  allocator_type get_allocator() const noexcept;
69
 
70
  // iterators:
71
  iterator begin() noexcept;
 
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;
115
 
116
+ template<class C2>
117
+ void merge(multiset<Key, C2, Allocator>& source);
118
+ template<class C2>
119
+ void merge(multiset<Key, C2, Allocator>&& source);
120
+ template<class C2>
121
+ void merge(set<Key, C2, Allocator>& source);
122
+ template<class C2>
123
+ void merge(set<Key, C2, Allocator>&& source);
124
+
125
  // observers:
126
  key_compare key_comp() const;
127
  value_compare value_comp() const;
128
 
129
  // set operations:
 
151
  pair<iterator, iterator> equal_range(const K& x);
152
  template <class K>
153
  pair<const_iterator, const_iterator> equal_range(const K& x) const;
154
  };
155
 
156
+ template<class InputIterator,
157
+ class Compare = less<typename iterator_traits<InputIterator>::value_type>,
158
+ class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
159
+ multiset(InputIterator, InputIterator,
160
+ Compare = Compare(), Allocator = Allocator())
161
+ -> multiset<typename iterator_traits<InputIterator>::value_type, Compare, Allocator>;
162
+
163
+ template<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>
164
+ multiset(initializer_list<Key>, Compare = Compare(), Allocator = Allocator())
165
+ -> multiset<Key, Compare, Allocator>;
166
+
167
+ template<class InputIterator, class Allocator>
168
+ multiset(InputIterator, InputIterator, Allocator)
169
+ -> multiset<typename iterator_traits<InputIterator>::value_type,
170
+ less<typename iterator_traits<InputIterator>::value_type>, Allocator>;
171
+
172
+ template<class Key, class Allocator>
173
+ multiset(initializer_list<Key>, Allocator) -> multiset<Key, less<Key>, Allocator>;
174
+
175
  template <class Key, class Compare, class Allocator>
176
  bool operator==(const multiset<Key, Compare, Allocator>& x,
177
  const multiset<Key, Compare, Allocator>& y);
178
  template <class Key, class Compare, class Allocator>
179
  bool operator< (const multiset<Key, Compare, Allocator>& x,
 
189
  const multiset<Key, Compare, Allocator>& y);
190
  template <class Key, class Compare, class Allocator>
191
  bool operator<=(const multiset<Key, Compare, Allocator>& x,
192
  const multiset<Key, Compare, Allocator>& y);
193
 
194
+ // [multiset.special], specialized algorithms
195
  template <class Key, class Compare, class Allocator>
196
  void swap(multiset<Key, Compare, Allocator>& x,
197
+ multiset<Key, Compare, Allocator>& y)
198
+ noexcept(noexcept(x.swap(y)));
199
  }
200
  ```
201