From Jason Turner

[flat.set.defn]

Diff to HTML by rtfpessoa

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