From Jason Turner

[flat.multiset.defn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpkltuujev/{from.md → to.md} +262 -0
tmp/tmpkltuujev/{from.md → to.md} RENAMED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Definition <a id="flat.multiset.defn">[[flat.multiset.defn]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class Key, class Compare = less<Key>, class KeyContainer = vector<Key>>
6
+ class flat_multiset {
7
+ public:
8
+ // types
9
+ using key_type = Key;
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
204
+ };
205
+
206
+ template<class KeyContainer, class Compare = less<typename KeyContainer::value_type>>
207
+ flat_multiset(KeyContainer, Compare = Compare())
208
+ -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
209
+ template<class KeyContainer, class Allocator>
210
+ flat_multiset(KeyContainer, Allocator)
211
+ -> flat_multiset<typename KeyContainer::value_type,
212
+ less<typename KeyContainer::value_type>, KeyContainer>;
213
+ template<class KeyContainer, class Compare, class Allocator>
214
+ flat_multiset(KeyContainer, Compare, Allocator)
215
+ -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
216
+
217
+ template<class KeyContainer, class Compare = less<typename KeyContainer::value_type>>
218
+ flat_multiset(sorted_equivalent_t, KeyContainer, Compare = Compare())
219
+ -> flat_multiset<typename KeyContainer::value_type, Compare, KeyContainer>;
220
+ template<class KeyContainer, class Allocator>
221
+ flat_multiset(sorted_equivalent_t, KeyContainer, Allocator)
222
+ -> flat_multiset<typename KeyContainer::value_type,
223
+ less<typename KeyContainer::value_type>, KeyContainer>;
224
+ template<class KeyContainer, class Compare, class Allocator>
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,
240
+ vector<ranges::range_value_t<R>,
241
+ alloc-rebind<Allocator, ranges::range_value_t<R>>>>;
242
+
243
+ template<ranges::input_range R, class Allocator>
244
+ flat_multiset(from_range_t, R&&, Allocator)
245
+ -> flat_multiset<ranges::range_value_t<R>, less<ranges::range_value_t<R>>,
246
+ vector<ranges::range_value_t<R>,
247
+ alloc-rebind<Allocator, ranges::range_value_t<R>>>>;
248
+
249
+ template<class Key, class Compare = less<Key>>
250
+ flat_multiset(initializer_list<Key>, Compare = Compare())
251
+ -> flat_multiset<Key, Compare>;
252
+
253
+ template<class Key, class Compare = less<Key>>
254
+ flat_multiset(sorted_equivalent_t, initializer_list<Key>, Compare = Compare())
255
+ -> flat_multiset<Key, Compare>;
256
+
257
+ template<class Key, class Compare, class KeyContainer, class Allocator>
258
+ struct uses_allocator<flat_multiset<Key, Compare, KeyContainer>, Allocator>
259
+ : bool_constant<uses_allocator_v<KeyContainer, Allocator>> { };
260
+ }
261
+ ```
262
+