From Jason Turner

[flat.multiset.defn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp45qp_o3m/{from.md → to.md} +134 -123
tmp/tmp45qp_o3m/{from.md → to.md} RENAMED
@@ -10,194 +10,205 @@ namespace std {
10
  using value_type = Key;
11
  using key_compare = Compare;
12
  using value_compare = Compare;
13
  using reference = value_type&;
14
  using const_reference = const value_type&;
15
- using size_type = typename KeyContainer::size_type;
16
- using difference_type = typename KeyContainer::difference_type;
17
  using iterator = implementation-defined // type of flat_multiset::iterator; // see [container.requirements]
18
  using const_iterator = implementation-defined // type of flat_multiset::const_iterator; // see [container.requirements]
19
  using reverse_iterator = std::reverse_iterator<iterator>;
20
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
21
  using container_type = KeyContainer;
22
 
23
  // [flat.multiset.cons], constructors
24
- flat_multiset() : flat_multiset(key_compare()) { }
25
 
26
- explicit flat_multiset(container_type cont, const key_compare& comp = key_compare());
27
- template<class Allocator>
28
- flat_multiset(const container_type& cont, const Allocator& a);
29
- template<class Allocator>
30
- flat_multiset(const container_type& cont, const key_compare& comp, const Allocator& a);
31
-
32
- flat_multiset(sorted_equivalent_t, container_type cont,
33
- const key_compare& comp = key_compare())
34
- : c(std::move(cont)), compare(comp) { }
35
- template<class Allocator>
36
- flat_multiset(sorted_equivalent_t, const container_type&, const Allocator& a);
37
- template<class Allocator>
38
- flat_multiset(sorted_equivalent_t, const container_type& cont,
39
- const key_compare& comp, const Allocator& a);
40
-
41
- explicit flat_multiset(const key_compare& comp)
42
  : c(), compare(comp) { }
43
- template<class Allocator>
44
- flat_multiset(const key_compare& comp, const Allocator& a);
45
- template<class Allocator>
46
- explicit flat_multiset(const Allocator& a);
 
 
 
47
 
48
  template<class InputIterator>
49
- flat_multiset(InputIterator first, InputIterator last,
50
  const key_compare& comp = key_compare())
51
  : c(), compare(comp)
52
  { insert(first, last); }
53
- template<class InputIterator, class Allocator>
54
- flat_multiset(InputIterator first, InputIterator last,
55
- const key_compare& comp, const Allocator& a);
56
- template<class InputIterator, class Allocator>
57
- flat_multiset(InputIterator first, InputIterator last, const Allocator& a);
58
 
59
  template<container-compatible-range<value_type> R>
60
- flat_multiset(from_range_t fr, R&& rg)
61
- : flat_multiset(fr, std::forward<R>(rg), key_compare()) { }
62
- template<container-compatible-range<value_type> R, class Allocator>
63
- flat_multiset(from_range_t, R&& rg, const Allocator& a);
64
  template<container-compatible-range<value_type> R>
65
- flat_multiset(from_range_t, R&& rg, const key_compare& comp)
66
  : flat_multiset(comp)
67
  { insert_range(std::forward<R>(rg)); }
68
- template<container-compatible-range<value_type> R, class Allocator>
69
- flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a);
70
 
71
- template<class InputIterator>
72
- flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
73
  const key_compare& comp = key_compare())
74
- : c(first, last), compare(comp) { }
75
- template<class InputIterator, class Allocator>
76
- flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
77
- const key_compare& comp, const Allocator& a);
78
- template<class InputIterator, class Allocator>
79
- flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
80
- const Allocator& a);
81
-
82
- flat_multiset(initializer_list<value_type> il, const key_compare& comp = key_compare())
83
  : flat_multiset(il.begin(), il.end(), comp) { }
84
- template<class Allocator>
85
- flat_multiset(initializer_list<value_type> il, const key_compare& comp,
86
- const Allocator& a);
87
- template<class Allocator>
88
- flat_multiset(initializer_list<value_type> il, const Allocator& a);
89
 
90
- flat_multiset(sorted_equivalent_t s, initializer_list<value_type> il,
91
  const key_compare& comp = key_compare())
92
- : flat_multiset(s, il.begin(), il.end(), comp) { }
93
- template<class Allocator>
94
- flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
95
- const key_compare& comp, const Allocator& a);
96
- template<class Allocator>
97
- flat_multiset(sorted_equivalent_t, initializer_list<value_type> il, const Allocator& a);
98
 
99
- flat_multiset& operator=(initializer_list<value_type>);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
  // iterators
102
- iterator begin() noexcept;
103
- const_iterator begin() const noexcept;
104
- iterator end() noexcept;
105
- const_iterator end() const noexcept;
106
 
107
- reverse_iterator rbegin() noexcept;
108
- const_reverse_iterator rbegin() const noexcept;
109
- reverse_iterator rend() noexcept;
110
- const_reverse_iterator rend() const noexcept;
111
 
112
- const_iterator cbegin() const noexcept;
113
- const_iterator cend() const noexcept;
114
- const_reverse_iterator crbegin() const noexcept;
115
- const_reverse_iterator crend() const noexcept;
116
 
117
  // capacity
118
- [[nodiscard]] bool empty() const noexcept;
119
- size_type size() const noexcept;
120
- size_type max_size() const noexcept;
121
 
122
  // [flat.multiset.modifiers], modifiers
123
- template<class... Args> iterator emplace(Args&&... args);
124
  template<class... Args>
125
- iterator emplace_hint(const_iterator position, Args&&... args);
126
 
127
- iterator insert(const value_type& x)
128
  { return emplace(x); }
129
- iterator insert(value_type&& x)
130
  { return emplace(std::move(x)); }
131
- iterator insert(const_iterator position, const value_type& x)
132
  { return emplace_hint(position, x); }
133
- iterator insert(const_iterator position, value_type&& x)
134
  { return emplace_hint(position, std::move(x)); }
135
 
136
  template<class InputIterator>
137
- void insert(InputIterator first, InputIterator last);
138
  template<class InputIterator>
139
- void insert(sorted_equivalent_t, InputIterator first, InputIterator last);
140
  template<container-compatible-range<value_type> R>
141
- void insert_range(R&& rg);
142
 
143
- void insert(initializer_list<value_type> il)
144
  { insert(il.begin(), il.end()); }
145
- void insert(sorted_equivalent_t s, initializer_list<value_type> il)
146
- { insert(s, il.begin(), il.end()); }
147
 
148
- container_type extract() &&;
149
- void replace(container_type&&);
150
 
151
- iterator erase(iterator position);
152
- iterator erase(const_iterator position);
153
- size_type erase(const key_type& x);
154
- template<class K> size_type erase(K&& x);
155
- iterator erase(const_iterator first, const_iterator last);
156
 
157
- void swap(flat_multiset& y) noexcept;
158
- void clear() noexcept;
159
 
160
  // observers
161
- key_compare key_comp() const;
162
- value_compare value_comp() const;
163
 
164
  // set operations
165
- iterator find(const key_type& x);
166
- const_iterator find(const key_type& x) const;
167
- template<class K> iterator find(const K& x);
168
- template<class K> const_iterator find(const K& x) const;
169
 
170
- size_type count(const key_type& x) const;
171
- template<class K> size_type count(const K& x) const;
172
 
173
- bool contains(const key_type& x) const;
174
- template<class K> bool contains(const K& x) const;
175
 
176
- iterator lower_bound(const key_type& x);
177
- const_iterator lower_bound(const key_type& x) const;
178
- template<class K> iterator lower_bound(const K& x);
179
- template<class K> const_iterator lower_bound(const K& x) const;
180
 
181
- iterator upper_bound(const key_type& x);
182
- const_iterator upper_bound(const key_type& x) const;
183
- template<class K> iterator upper_bound(const K& x);
184
- template<class K> const_iterator upper_bound(const K& x) const;
185
 
186
- pair<iterator, iterator> equal_range(const key_type& x);
187
- pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
188
  template<class K>
189
- pair<iterator, iterator> equal_range(const K& x);
190
  template<class K>
191
- pair<const_iterator, const_iterator> equal_range(const K& x) const;
192
 
193
- friend bool operator==(const flat_multiset& x, const flat_multiset& y);
194
 
195
- friend synth-three-way-result<value_type>
196
  operator<=>(const flat_multiset& x, const flat_multiset& y);
197
 
198
- friend void swap(flat_multiset& x, flat_multiset& y) noexcept
199
  { x.swap(y); }
200
 
201
  private:
202
  container_type c; // exposition only
203
  key_compare compare; // exposition only
@@ -225,15 +236,15 @@ namespace std {
225
  flat_multiset(sorted_equivalent_t, KeyContainer, Compare, Allocator)
226
  -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
227
 
228
  template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
229
  flat_multiset(InputIterator, InputIterator, Compare = Compare())
230
- -> flat_multiset<iter-value-type<InputIterator>, iter-value-type<InputIterator>, Compare>;
231
 
232
  template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
233
  flat_multiset(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare())
234
- -> flat_multiset<iter-value-type<InputIterator>, iter-value-type<InputIterator>, Compare>;
235
 
236
  template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
237
  class Allocator = allocator<ranges::range_value_t<R>>>
238
  flat_multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
239
  -> flat_multiset<ranges::range_value_t<R>, Compare,
 
10
  using value_type = Key;
11
  using key_compare = Compare;
12
  using value_compare = Compare;
13
  using reference = value_type&;
14
  using const_reference = const value_type&;
15
+ using size_type = KeyContainer::size_type;
16
+ using difference_type = KeyContainer::difference_type;
17
  using iterator = implementation-defined // type of flat_multiset::iterator; // see [container.requirements]
18
  using const_iterator = implementation-defined // type of flat_multiset::const_iterator; // see [container.requirements]
19
  using reverse_iterator = std::reverse_iterator<iterator>;
20
  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
21
  using container_type = KeyContainer;
22
 
23
  // [flat.multiset.cons], constructors
24
+ constexpr flat_multiset() : flat_multiset(key_compare()) { }
25
 
26
+ constexpr explicit flat_multiset(const key_compare& comp)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  : c(), compare(comp) { }
28
+
29
+ constexpr explicit flat_multiset(container_type cont,
30
+ const key_compare& comp = key_compare());
31
+
32
+ constexpr flat_multiset(sorted_equivalent_t, container_type cont,
33
+ const key_compare& comp = key_compare())
34
+ : c(std::move(cont)), compare(comp) { }
35
 
36
  template<class InputIterator>
37
+ constexpr flat_multiset(InputIterator first, InputIterator last,
38
  const key_compare& comp = key_compare())
39
  : c(), compare(comp)
40
  { insert(first, last); }
41
+
42
+ template<class InputIterator>
43
+ constexpr flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
44
+ const key_compare& comp = key_compare())
45
+ : c(first, last), compare(comp) { }
46
 
47
  template<container-compatible-range<value_type> R>
48
+ constexpr flat_multiset(from_range_t, R&& rg)
49
+ : flat_multiset(from_range, std::forward<R>(rg), key_compare()) { }
 
 
50
  template<container-compatible-range<value_type> R>
51
+ constexpr flat_multiset(from_range_t, R&& rg, const key_compare& comp)
52
  : flat_multiset(comp)
53
  { insert_range(std::forward<R>(rg)); }
 
 
54
 
55
+ constexpr flat_multiset(initializer_list<value_type> il,
 
56
  const key_compare& comp = key_compare())
 
 
 
 
 
 
 
 
 
57
  : flat_multiset(il.begin(), il.end(), comp) { }
 
 
 
 
 
58
 
59
+ constexpr flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
60
  const key_compare& comp = key_compare())
61
+ : flat_multiset(sorted_equivalent, il.begin(), il.end(), comp) { }
 
 
 
 
 
62
 
63
+ // [flat.multiset.cons.alloc], constructors with allocators
64
+
65
+ template<class Alloc>
66
+ constexpr explicit flat_multiset(const Alloc& a);
67
+ template<class Alloc>
68
+ constexpr flat_multiset(const key_compare& comp, const Alloc& a);
69
+ template<class Alloc>
70
+ constexpr flat_multiset(const container_type& cont, const Alloc& a);
71
+ template<class Alloc>
72
+ constexpr flat_multiset(const container_type& cont, const key_compare& comp,
73
+ const Alloc& a);
74
+ template<class Alloc>
75
+ constexpr flat_multiset(sorted_equivalent_t, const container_type& cont, const Alloc& a);
76
+ template<class Alloc>
77
+ constexpr flat_multiset(sorted_equivalent_t, const container_type& cont,
78
+ const key_compare& comp, const Alloc& a);
79
+ template<class Alloc>
80
+ constexpr flat_multiset(const flat_multiset&, const Alloc& a);
81
+ template<class Alloc>
82
+ constexpr flat_multiset(flat_multiset&&, const Alloc& a);
83
+ template<class InputIterator, class Alloc>
84
+ constexpr flat_multiset(InputIterator first, InputIterator last, const Alloc& a);
85
+ template<class InputIterator, class Alloc>
86
+ constexpr flat_multiset(InputIterator first, InputIterator last,
87
+ const key_compare& comp, const Alloc& a);
88
+ template<class InputIterator, class Alloc>
89
+ constexpr flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
90
+ const Alloc& a);
91
+ template<class InputIterator, class Alloc>
92
+ constexpr flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last,
93
+ const key_compare& comp, const Alloc& a);
94
+ template<container-compatible-range<value_type> R, class Alloc>
95
+ constexpr flat_multiset(from_range_t, R&& rg, const Alloc& a);
96
+ template<container-compatible-range<value_type> R, class Alloc>
97
+ constexpr flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
98
+ template<class Alloc>
99
+ constexpr flat_multiset(initializer_list<value_type> il, const Alloc& a);
100
+ template<class Alloc>
101
+ constexpr flat_multiset(initializer_list<value_type> il, const key_compare& comp,
102
+ const Alloc& a);
103
+ template<class Alloc>
104
+ constexpr flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
105
+ const Alloc& a);
106
+ template<class Alloc>
107
+ constexpr flat_multiset(sorted_equivalent_t, initializer_list<value_type> il,
108
+ const key_compare& comp, const Alloc& a);
109
+
110
+ constexpr flat_multiset& operator=(initializer_list<value_type>);
111
 
112
  // iterators
113
+ constexpr iterator begin() noexcept;
114
+ constexpr const_iterator begin() const noexcept;
115
+ constexpr iterator end() noexcept;
116
+ constexpr const_iterator end() const noexcept;
117
 
118
+ constexpr reverse_iterator rbegin() noexcept;
119
+ constexpr const_reverse_iterator rbegin() const noexcept;
120
+ constexpr reverse_iterator rend() noexcept;
121
+ constexpr const_reverse_iterator rend() const noexcept;
122
 
123
+ constexpr const_iterator cbegin() const noexcept;
124
+ constexpr const_iterator cend() const noexcept;
125
+ constexpr const_reverse_iterator crbegin() const noexcept;
126
+ constexpr const_reverse_iterator crend() const noexcept;
127
 
128
  // capacity
129
+ constexpr bool empty() const noexcept;
130
+ constexpr size_type size() const noexcept;
131
+ constexpr size_type max_size() const noexcept;
132
 
133
  // [flat.multiset.modifiers], modifiers
134
+ template<class... Args> constexpr iterator emplace(Args&&... args);
135
  template<class... Args>
136
+ constexpr iterator emplace_hint(const_iterator position, Args&&... args);
137
 
138
+ constexpr iterator insert(const value_type& x)
139
  { return emplace(x); }
140
+ constexpr iterator insert(value_type&& x)
141
  { return emplace(std::move(x)); }
142
+ constexpr iterator insert(const_iterator position, const value_type& x)
143
  { return emplace_hint(position, x); }
144
+ constexpr iterator insert(const_iterator position, value_type&& x)
145
  { return emplace_hint(position, std::move(x)); }
146
 
147
  template<class InputIterator>
148
+ constexpr void insert(InputIterator first, InputIterator last);
149
  template<class InputIterator>
150
+ constexpr void insert(sorted_equivalent_t, InputIterator first, InputIterator last);
151
  template<container-compatible-range<value_type> R>
152
+ constexpr void insert_range(R&& rg);
153
 
154
+ constexpr void insert(initializer_list<value_type> il)
155
  { insert(il.begin(), il.end()); }
156
+ constexpr void insert(sorted_equivalent_t, initializer_list<value_type> il)
157
+ { insert(sorted_equivalent, il.begin(), il.end()); }
158
 
159
+ constexpr container_type extract() &&;
160
+ constexpr void replace(container_type&&);
161
 
162
+ constexpr iterator erase(iterator position);
163
+ constexpr iterator erase(const_iterator position);
164
+ constexpr size_type erase(const key_type& x);
165
+ template<class K> constexpr size_type erase(K&& x);
166
+ constexpr iterator erase(const_iterator first, const_iterator last);
167
 
168
+ constexpr void swap(flat_multiset& y) noexcept;
169
+ constexpr void clear() noexcept;
170
 
171
  // observers
172
+ constexpr key_compare key_comp() const;
173
+ constexpr value_compare value_comp() const;
174
 
175
  // set operations
176
+ constexpr iterator find(const key_type& x);
177
+ constexpr const_iterator find(const key_type& x) const;
178
+ template<class K> constexpr iterator find(const K& x);
179
+ template<class K> constexpr const_iterator find(const K& x) const;
180
 
181
+ constexpr size_type count(const key_type& x) const;
182
+ template<class K> constexpr size_type count(const K& x) const;
183
 
184
+ constexpr bool contains(const key_type& x) const;
185
+ template<class K> constexpr bool contains(const K& x) const;
186
 
187
+ constexpr iterator lower_bound(const key_type& x);
188
+ constexpr const_iterator lower_bound(const key_type& x) const;
189
+ template<class K> constexpr iterator lower_bound(const K& x);
190
+ template<class K> constexpr const_iterator lower_bound(const K& x) const;
191
 
192
+ constexpr iterator upper_bound(const key_type& x);
193
+ constexpr const_iterator upper_bound(const key_type& x) const;
194
+ template<class K> constexpr iterator upper_bound(const K& x);
195
+ template<class K> constexpr const_iterator upper_bound(const K& x) const;
196
 
197
+ constexpr pair<iterator, iterator> equal_range(const key_type& x);
198
+ constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const;
199
  template<class K>
200
+ constexpr pair<iterator, iterator> equal_range(const K& x);
201
  template<class K>
202
+ constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const;
203
 
204
+ friend constexpr bool operator==(const flat_multiset& x, const flat_multiset& y);
205
 
206
+ friend constexpr synth-three-way-result<value_type>
207
  operator<=>(const flat_multiset& x, const flat_multiset& y);
208
 
209
+ friend constexpr void swap(flat_multiset& x, flat_multiset& y) noexcept
210
  { x.swap(y); }
211
 
212
  private:
213
  container_type c; // exposition only
214
  key_compare compare; // exposition only
 
236
  flat_multiset(sorted_equivalent_t, KeyContainer, Compare, Allocator)
237
  -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
238
 
239
  template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
240
  flat_multiset(InputIterator, InputIterator, Compare = Compare())
241
+ -> flat_multiset<iter-value-type<InputIterator>, Compare>;
242
 
243
  template<class InputIterator, class Compare = less<iter-value-type<InputIterator>>>
244
  flat_multiset(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare())
245
+ -> flat_multiset<iter-value-type<InputIterator>, Compare>;
246
 
247
  template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>,
248
  class Allocator = allocator<ranges::range_value_t<R>>>
249
  flat_multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())
250
  -> flat_multiset<ranges::range_value_t<R>, Compare,