1010#ifndef _LIBCPP_MAP
1111#define _LIBCPP_MAP
1212
13+ // clang-format off
14+
1315/*
1416
1517 map synopsis
@@ -61,58 +63,54 @@ public:
6163 noexcept(
6264 is_nothrow_default_constructible<allocator_type>::value &&
6365 is_nothrow_default_constructible<key_compare>::value &&
64- is_nothrow_copy_constructible<key_compare>::value); // constexpr since C++26
65- constexpr explicit map(const key_compare& comp); // constexpr since C++26
66- constexpr map(const key_compare& comp, const allocator_type& a); // constexpr since C++26
66+ is_nothrow_copy_constructible<key_compare>::value); // constexpr since C++26
67+ constexpr explicit map(const key_compare& comp); // constexpr since C++26
68+ constexpr map(const key_compare& comp, const allocator_type& a); // constexpr since C++26
6769 template <class InputIterator>
6870 constexpr map(InputIterator first, InputIterator last,
69- const key_compare& comp = key_compare()); // constexpr since C++26
71+ const key_compare& comp = key_compare()); // constexpr since C++26
7072 template <class InputIterator>
7173 constexpr map(InputIterator first, InputIterator last,
72- const key_compare& comp, const allocator_type& a); // constexpr since C++26
74+ const key_compare& comp, const allocator_type& a); // constexpr since C++26
7375 template<container-compatible-range<value_type> R>
74- constexpr map(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23,
75- constexpr since C++26
76-
77- constexpr map(const map& m); // constexpr since C++26
76+ constexpr map(from_range_t, R&& rg, const Compare& comp = Compare(), const Allocator& = Allocator()); // C++23, constexpr since C++26
77+ constexpr map(const map& m); // constexpr since C++26
7878 constexpr map(map&& m)
7979 noexcept(
8080 is_nothrow_move_constructible<allocator_type>::value &&
81- is_nothrow_move_constructible<key_compare>::value); // constexpr since C++26
82- constexpr explicit map(const allocator_type& a); // constexpr since C++26
83- constexpr map(const map& m, const allocator_type& a); // constexpr since C++26
84- constexpr map(map&& m, const allocator_type& a); // constexpr since C++26
85- constexpr map(initializer_list<value_type> il, const key_compare& comp = key_compare()); // constexpr since C++26
86- constexpr map(initializer_list<value_type> il, const key_compare& comp, const allocator_type& a); // constexpr since
87- C++26
88-
89- template <class InputIterator> constexpr map(InputIterator first, InputIterator last, const allocator_type& a) :
90- map(first, last, Compare(), a) {} // C++14 // constexpr since C++26
91-
81+ is_nothrow_move_constructible<key_compare>::value); // constexpr since C++26
82+ constexpr explicit map(const allocator_type& a); // constexpr since C++26
83+ constexpr map(const map& m, const allocator_type& a); // constexpr since C++26
84+ constexpr map(map&& m, const allocator_type& a); // constexpr since C++26
85+ constexpr map(initializer_list<value_type> il, const key_compare& comp = key_compare()); // constexpr since C++26
86+ constexpr map(initializer_list<value_type> il, const key_compare& comp, const allocator_type& a); // constexpr since C++26
87+ template <class InputIterator>
88+ constexpr map(InputIterator first, InputIterator last, const allocator_type& a)
89+ : map(first, last, Compare(), a) {} // C++14, constexpr since C++26
9290 template<container-compatible-range<value_type> R>
9391 constexpr map(from_range_t, R&& rg, const Allocator& a))
94- : map(from_range, std::forward<R>(rg), Compare(), a) { } // C++23, constexpr since C++26
92+ : map(from_range, std::forward<R>(rg), Compare(), a) { } // C++23, constexpr since C++26
9593 constexpr map(initializer_list<value_type> il, const allocator_type& a)
96- : map(il, Compare(), a) {} // C++14 // constexpr since C++26
97- constexpr ~map(); // constexpr since C++26
94+ : map(il, Compare(), a) {} // C++14, constexpr since C++26
95+ constexpr ~map(); // constexpr since C++26
9896
99- constexpr map& operator=(const map& m); // constexpr since C++26
97+ constexpr map& operator=(const map& m); // constexpr since C++26
10098 constexpr map& operator=(map&& m)
10199 noexcept(
102100 allocator_type::propagate_on_container_move_assignment::value &&
103101 is_nothrow_move_assignable<allocator_type>::value &&
104- is_nothrow_move_assignable<key_compare>::value); // constexpr since C++26
105- constexpr map& operator=(initializer_list<value_type> il); // constexpr since C++26
102+ is_nothrow_move_assignable<key_compare>::value); // constexpr since C++26
103+ constexpr map& operator=(initializer_list<value_type> il); // constexpr since C++26
106104
107105 // iterators:
108- constexpr iterator begin() noexcept; // constexpr since C++26
106+ constexpr iterator begin() noexcept; // constexpr since C++26
109107 constexpr const_iterator begin() const noexcept; // constexpr since C++26
110- constexpr iterator end() noexcept; // constexpr since C++26
108+ constexpr iterator end() noexcept; // constexpr since C++26
111109 constexpr const_iterator end() const noexcept; // constexpr since C++26
112110
113- constexpr reverse_iterator rbegin() noexcept; // constexpr since C++26
111+ constexpr reverse_iterator rbegin() noexcept; // constexpr since C++26
114112 constexpr const_reverse_iterator rbegin() const noexcept; // constexpr since C++26
115- constexpr reverse_iterator rend() noexcept; // constexpr since C++26
113+ constexpr reverse_iterator rend() noexcept; // constexpr since C++26
116114 constexpr const_reverse_iterator rend() const noexcept; // constexpr since C++26
117115
118116 constexpr const_iterator cbegin() const noexcept; // constexpr since C++26
@@ -127,85 +125,55 @@ map(first, last, Compare(), a) {} // C++14 // constexpr since C++26
127125
128126 // element access:
129127 constexpr mapped_type& operator[](const key_type& k); // constexpr since C++26
130- constexpr mapped_type& operator[](key_type&& k); // constexpr since C++26
128+ constexpr mapped_type& operator[](key_type&& k); // constexpr since C++26
131129
132- constexpr mapped_type& at(const key_type& k); // constexpr since C++26
130+ constexpr mapped_type& at(const key_type& k); // constexpr since C++26
133131 constexpr const mapped_type& at(const key_type& k) const; // constexpr since C++26
134132
135133 // modifiers:
136134 template <class... Args>
137- constexpr pair<iterator, bool> emplace(Args&&... args); // constexpr since C++26
135+ constexpr pair<iterator, bool> emplace(Args&&... args); // constexpr since C++26
138136 template <class... Args>
139- constexpr iterator emplace_hint(const_iterator position, Args&&... args); // constexpr since C++26
140- constexpr pair<iterator, bool> insert(const value_type& v); // constexpr since C++26
141- constexpr pair<iterator, bool> insert( value_type&& v); // C++17, constexpr
142- since C++26
143-
137+ constexpr iterator emplace_hint(const_iterator position, Args&&... args); // constexpr since C++26
138+ constexpr pair<iterator, bool> insert(const value_type& v); // constexpr since C++26
139+ constexpr pair<iterator, bool> insert( value_type&& v); // C++17, constexpr since C++26
144140 template <class P> constexpr pair<iterator, bool> insert(P&& p); // constexpr since C++26
145-
146- constexpr iterator insert(const_iterator position, const value_type& v); // constexpr since C++26
147-
148- constexpr iterator insert(const_iterator position, value_type&& v); // C++17, constexpr
149- since C++26
150-
151- template <class P> constexpr iterator insert(const_iterator position, P&& p); // constexpr since C++26
152-
153- template <class InputIterator> constexpr void insert(InputIterator first, InputIterator last); // constexpr since
154- C++26
141+ constexpr iterator insert(const_iterator position, const value_type& v); // constexpr since C++26
142+ constexpr iterator insert(const_iterator position, value_type&& v); // C++17, constexpr since C++26
143+ template <class P> constexpr iterator insert(const_iterator position, P&& p); // constexpr since C++26
144+ template <class InputIterator> constexpr void insert(InputIterator first, InputIterator last); // constexpr since C++26
155145
156146 template<container-compatible-range<value_type> R>
157- constexpr void insert_range(R&& rg); // C++23, constexpr
158- since C++26
159-
160- constexpr void insert(initializer_list<value_type> il); // constexpr since C++26
147+ constexpr void insert_range(R&& rg); // C++23, constexpr since C++26
148+ constexpr void insert(initializer_list<value_type> il); // constexpr since C++26
161149
162- constexpr node_type extract(const_iterator position); // C++17, constexpr
163- since C++26
164-
165- constexpr node_type extract(const key_type& x); // C++17, constexpr
166- since C++26
167-
168- constexpr insert_return_type insert(node_type&& nh); // C++17, constexpr
169- since C++26
170-
171- constexpr iterator insert(const_iterator hint, node_type&& nh); // C++17, constexpr since C++26
150+ constexpr node_type extract(const_iterator position); // C++17, constexpr since C++26
151+ constexpr node_type extract(const key_type& x); // C++17, constexpr since C++26
152+ constexpr insert_return_type insert(node_type&& nh); // C++17, constexpr since C++26
153+ constexpr iterator insert(const_iterator hint, node_type&& nh); // C++17, constexpr since C++26
172154
173155 template <class... Args>
174- constexpr pair<iterator, bool> try_emplace(const key_type& k, Args&&... args); // C++17, constexpr
175- since C++26
176-
156+ constexpr pair<iterator, bool> try_emplace(const key_type& k, Args&&... args); // C++17, constexpr since C++26
177157 template <class... Args>
178- constexpr pair<iterator, bool> try_emplace(key_type&& k, Args&&... args); // C++17 // constexpr since C++26
179-
158+ constexpr pair<iterator, bool> try_emplace(key_type&& k, Args&&... args); // C++17, constexpr since C++26
180159 template <class... Args>
181- constexpr iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17, constexpr
182- since C++26
183-
160+ constexpr iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // C++17, constexpr since C++26
184161 template <class... Args>
185- constexpr iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17, constexpr since
186- C++26
187-
162+ constexpr iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // C++17, constexpr since C++26
188163 template <class M>
189- constexpr pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj); // C++17,
190- constexpr since C++26
191-
164+ constexpr pair<iterator, bool> insert_or_assign(const key_type& k, M&& obj); // C++17, constexpr since C++26
192165 template <class M>
193- constexpr pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj); // C++17, constexpr since
194- C++26
195-
166+ constexpr pair<iterator, bool> insert_or_assign(key_type&& k, M&& obj); // C++17, constexpr since C++26
196167 template <class M>
197- constexpr iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17, constexpr since
198- C++26
199-
168+ constexpr iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // C++17, constexpr since C++26
200169 template <class M>
201- constexpr iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17, constexpr since
202- C++26
170+ constexpr iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // C++17, constexpr since C++26
203171
204- constexpr iterator erase(const_iterator position); // constexpr since C++26
205- constexpr iterator erase(iterator position); // C++14, constexpr since C++26
206- constexpr size_type erase(const key_type& k); // constexpr since C++26
172+ constexpr iterator erase(const_iterator position); // constexpr since C++26
173+ constexpr iterator erase(iterator position); // C++14, constexpr since C++26
174+ constexpr size_type erase(const key_type& k); // constexpr since C++26
207175 constexpr iterator erase(const_iterator first, const_iterator last); // constexpr since C++26
208- constexpr void clear() noexcept; // constexpr since C++26
176+ constexpr void clear() noexcept; // constexpr since C++26
209177
210178 template<class C2>
211179 constexpr void merge(map<Key, T, C2, Allocator>& source); // C++17, constexpr since C++26
@@ -218,48 +186,48 @@ C++26
218186
219187 constexpr void swap(map& m)
220188 noexcept(allocator_traits<allocator_type>::is_always_equal::value &&
221- is_nothrow_swappable<key_compare>::value); // C++17, constexpr since C++26
189+ is_nothrow_swappable<key_compare>::value); // C++17, constexpr since C++26
222190
223191 // observers:
224192 constexpr allocator_type get_allocator() const noexcept; // constexpr since C++26
225- constexpr key_compare key_comp() const; // constexpr since C++26
226- constexpr value_compare value_comp() const; // constexpr since C++26
193+ constexpr key_compare key_comp() const; // constexpr since C++26
194+ constexpr value_compare value_comp() const; // constexpr since C++26
227195
228196 // map operations:
229- constexpr iterator find(const key_type& k); // constexpr since C++26
197+ constexpr iterator find(const key_type& k); // constexpr since C++26
230198 constexpr const_iterator find(const key_type& k) const; // constexpr since C++26
231199 template<typename K>
232200 constexpr iterator find(const K& x); // C++14, constexpr since C++26
233201 template<typename K>
234202 constexpr const_iterator find(const K& x) const; // C++14, constexpr since C++26
235203
236204 template<typename K>
237- constexpr size_type count(const K& x) const; // C++14, constexpr since C++26
205+ constexpr size_type count(const K& x) const; // C++14, constexpr since C++26
238206 constexpr size_type count(const key_type& k) const; // constexpr since C++26
239207
240208 constexpr bool contains(const key_type& x) const; // C++20, constexpr since C++26
241209 template<class K> constexpr bool contains(const K& x) const; // C++20, constexpr since C++26
242210
243- constexpr iterator lower_bound(const key_type& k); // constexpr since C++26
211+ constexpr iterator lower_bound(const key_type& k); // constexpr since C++26
244212 constexpr const_iterator lower_bound(const key_type& k) const; // constexpr since C++26
245213 template<typename K>
246- constexpr iterator lower_bound(const K& x); // C++14, constexpr since C++26
214+ constexpr iterator lower_bound(const K& x); // C++14, constexpr since C++26
247215 template<typename K>
248- constexpr const_iterator lower_bound(const K& x) const; // C++14, constexpr since C++26
216+ constexpr const_iterator lower_bound(const K& x) const; // C++14, constexpr since C++26
249217
250- constexpr iterator upper_bound(const key_type& k); // constexpr since C++26
218+ constexpr iterator upper_bound(const key_type& k); // constexpr since C++26
251219 constexpr const_iterator upper_bound(const key_type& k) const; // constexpr since C++26
252220 template<typename K>
253- constexpr iterator upper_bound(const K& x); // C++14, constexpr since C++26
221+ constexpr iterator upper_bound(const K& x); // C++14, constexpr since C++26
254222 template<typename K>
255- constexpr const_iterator upper_bound(const K& x) const; // C++14, constexpr since C++26
223+ constexpr const_iterator upper_bound(const K& x) const; // C++14, constexpr since C++26
256224
257- constexpr pair<iterator,iterator> equal_range(const key_type& k); // constexpr since C++26
225+ constexpr pair<iterator,iterator> equal_range(const key_type& k); // constexpr since C++26
258226 constexpr pair<const_iterator,const_iterator> equal_range(const key_type& k) const; // constexpr since C++26
259227 template<typename K>
260- constexpr pair<iterator,iterator> equal_range(const K& x); // C++14, constexpr since C++26
228+ constexpr pair<iterator,iterator> equal_range(const K& x); // C++14, constexpr since C++26
261229 template<typename K>
262- constexpr pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14, constexpr since C++26
230+ constexpr pair<const_iterator,const_iterator> equal_range(const K& x) const; // C++14, constexpr since C++26
263231};
264232
265233template <class InputIterator,
@@ -443,7 +411,7 @@ public:
443411 template <class... Args>
444412 iterator emplace(Args&&... args);
445413 template <class... Args>
446- iterator emplace_hint(const_iterator position, Args&&... args);
414+ iterator emplace_hint(const_iterator position, Args&&... args);
447415 iterator insert(const value_type& v);
448416 iterator insert( value_type&& v); // C++17
449417 template <class P>
@@ -603,6 +571,8 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
603571
604572*/
605573
574+ // clang-format off
575+
606576#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
607577# include < __cxx03/map>
608578#else
0 commit comments