29#ifndef _GLIBCXX_FLAT_MAP
30#define _GLIBCXX_FLAT_MAP 1
33#pragma GCC system_header
36#define __glibcxx_want_constexpr_flat_map
37#define __glibcxx_want_flat_map
40#ifdef __cpp_lib_flat_map
58namespace std _GLIBCXX_VISIBILITY(default)
60_GLIBCXX_BEGIN_NAMESPACE_VERSION
62 template<
typename _Key,
typename _Tp,
typename _Compare,
63 typename _KeyContainer,
typename _MappedContainer>
66 template<
typename _Key,
typename _Tp,
typename _Compare,
67 typename _KeyContainer,
typename _MappedContainer>
70 template<
typename _Key,
typename _Tp,
typename _Compare,
71 typename _KeyContainer,
typename _MappedContainer,
bool _Multi>
74 static_assert(is_same_v<_Key, typename _KeyContainer::value_type>);
75 static_assert(is_same_v<_Tp, typename _MappedContainer::value_type>);
77 static_assert(is_nothrow_swappable_v<_KeyContainer>);
78 static_assert(is_nothrow_swappable_v<_MappedContainer>);
80 using _Derived = __conditional_t<_Multi,
81 flat_multimap<_Key, _Tp, _Compare,
82 _KeyContainer, _MappedContainer>,
83 flat_map<_Key, _Tp, _Compare,
84 _KeyContainer, _MappedContainer>>;
85 using __sorted_t = __conditional_t<_Multi, sorted_equivalent_t, sorted_unique_t>;
88 template<
bool _Const>
struct _Iterator;
90 using key_type = _Key;
91 using mapped_type = _Tp;
92 using value_type = pair<key_type, mapped_type>;
93 using key_compare = _Compare;
94 using reference = pair<const key_type&, mapped_type&>;
95 using const_reference = pair<const key_type&, const mapped_type&>;
96 using size_type = size_t;
97 using difference_type = ptrdiff_t;
98 using iterator = _Iterator<false>;
99 using const_iterator = _Iterator<true>;
100 using reverse_iterator = std::reverse_iterator<iterator>;
101 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
102 using key_container_type = _KeyContainer;
103 using mapped_container_type = _MappedContainer;
106 using __emplace_result_t = __conditional_t<_Multi, iterator, pair<iterator, bool>>;
111 [[no_unique_address]] key_compare _M_comp;
113 value_compare(key_compare __c) : _M_comp(__c) { }
118 operator()(const_reference __x, const_reference __y)
const
119 {
return _M_comp(__x.first, __y.first); }
121 friend _Flat_map_impl;
126 key_container_type keys;
127 mapped_container_type values;
136 _ClearGuard(containers& __cont)
145 _M_cont->keys.clear();
146 _M_cont->values.clear();
153 { _M_cont =
nullptr; }
158 _M_make_clear_guard()
159 {
return _ClearGuard{this->_M_cont}; }
164 _Flat_map_impl() : _Flat_map_impl(key_compare()) { }
168 _Flat_map_impl(
const key_compare& __comp)
169 : _M_cont(), _M_comp(__comp)
173 _Flat_map_impl(key_container_type __key_cont,
174 mapped_container_type __mapped_cont,
175 const key_compare& __comp = key_compare())
176 : _M_cont(std::move(__key_cont), std::move(__mapped_cont)), _M_comp(__comp)
178 __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size());
183 _Flat_map_impl(__sorted_t,
184 key_container_type __key_cont,
185 mapped_container_type __mapped_cont,
186 const key_compare& __comp = key_compare())
187 : _M_cont(std::move(__key_cont), std::move(__mapped_cont)), _M_comp(__comp)
189 __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size());
190 _GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(_M_cont.keys, _M_comp));
193 template<__has_input_iter_cat _InputIterator>
195 _Flat_map_impl(_InputIterator __first, _InputIterator __last,
196 const key_compare& __comp = key_compare())
197 : _M_cont(), _M_comp(__comp)
198 { insert(__first, __last); }
200 template<__has_input_iter_cat _InputIterator>
202 _Flat_map_impl(__sorted_t __s,
203 _InputIterator __first, _InputIterator __last,
204 const key_compare& __comp = key_compare())
205 : _M_cont(), _M_comp(__comp)
206 { insert(__s, __first, __last); }
208 template<__detail::__container_compatible_range<value_type> _Rg>
210 _Flat_map_impl(from_range_t, _Rg&& __rg)
211 : _Flat_map_impl(from_range, std::
forward<_Rg>(__rg), key_compare())
214 template<__detail::__container_compatible_range<value_type> _Rg>
216 _Flat_map_impl(from_range_t, _Rg&& __rg,
const key_compare& __comp)
217 : _Flat_map_impl(__comp)
221 _Flat_map_impl(initializer_list<value_type> __il,
222 const key_compare& __comp = key_compare())
223 : _Flat_map_impl(__il.begin(), __il.end(), __comp)
227 _Flat_map_impl(__sorted_t __s,
228 initializer_list<value_type> __il,
229 const key_compare& __comp = key_compare())
230 : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)
235 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
238 _Flat_map_impl(
const _Alloc& __a)
239 : _Flat_map_impl(key_compare(), __a)
242 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
244 _Flat_map_impl(
const key_compare& __comp,
const _Alloc& __a)
245 : _M_cont(std::make_obj_using_allocator<key_container_type>(__a),
246 std::make_obj_using_allocator<mapped_container_type>(__a)),
250 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
252 _Flat_map_impl(
const key_container_type& __key_cont,
253 const mapped_container_type& __mapped_cont,
255 : _Flat_map_impl(__key_cont, __mapped_cont, key_compare(), __a)
258 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
260 _Flat_map_impl(
const key_container_type& __key_cont,
261 const mapped_container_type& __mapped_cont,
262 const key_compare& __comp,
264 : _M_cont(std::make_obj_using_allocator<key_container_type>(__a, __key_cont),
265 std::make_obj_using_allocator<mapped_container_type>(__a, __mapped_cont)),
268 __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size());
272 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
274 _Flat_map_impl(__sorted_t __s,
275 const key_container_type& __key_cont,
276 const mapped_container_type& __mapped_cont,
278 : _Flat_map_impl(__s, __key_cont, __mapped_cont, key_compare(), __a)
281 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
283 _Flat_map_impl(__sorted_t,
284 const key_container_type& __key_cont,
285 const mapped_container_type& __mapped_cont,
286 const key_compare& __comp,
288 : _M_cont(std::make_obj_using_allocator<key_container_type>(__a, __key_cont),
289 std::make_obj_using_allocator<mapped_container_type>(__a, __mapped_cont)),
292 __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size());
293 _GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(_M_cont.keys, _M_comp));
296 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
298 _Flat_map_impl(
const _Derived& __x,
const _Alloc& __a)
299 : _M_cont(std::make_obj_using_allocator<key_container_type>(__a, __x._M_cont.keys),
300 std::make_obj_using_allocator<mapped_container_type>(__a, __x._M_cont.values)),
304 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
306 _Flat_map_impl(_Derived&& __x,
const _Alloc& __a)
307 : _M_cont(std::make_obj_using_allocator<key_container_type>
308 (__a, std::move(__x._M_cont.keys)),
309 std::make_obj_using_allocator<mapped_container_type>
310 (__a, std::move(__x._M_cont.values))),
314 template<__has_input_iter_cat _InputIterator,
315 __allocator_for<key_container_type, mapped_container_type> _Alloc>
317 _Flat_map_impl(_InputIterator __first, _InputIterator __last,
319 : _Flat_map_impl(std::move(__first), std::move(__last), key_compare(), __a)
322 template<__has_input_iter_cat _InputIterator,
323 __allocator_for<key_container_type, mapped_container_type> _Alloc>
325 _Flat_map_impl(_InputIterator __first, _InputIterator __last,
326 const key_compare& __comp,
328 : _Flat_map_impl(__comp, __a)
329 { insert(__first, __last); }
331 template<__has_input_iter_cat _InputIterator,
332 __allocator_for<key_container_type, mapped_container_type> _Alloc>
334 _Flat_map_impl(__sorted_t __s,
335 _InputIterator __first, _InputIterator __last,
337 : _Flat_map_impl(__s, std::move(__first), std::move(__last), key_compare(), __a)
340 template<__has_input_iter_cat _InputIterator,
341 __allocator_for<key_container_type, mapped_container_type> _Alloc>
343 _Flat_map_impl(__sorted_t __s,
344 _InputIterator __first, _InputIterator __last,
345 const key_compare& __comp,
347 : _Flat_map_impl(__comp, __a)
348 { insert(__s, __first, __last); }
350 template<__detail::__container_compatible_range<value_type> _Rg,
351 __allocator_for<key_container_type, mapped_container_type> _Alloc>
353 _Flat_map_impl(from_range_t, _Rg&& __rg,
355 : _Flat_map_impl(from_range, std::
forward<_Rg>(__rg), key_compare(), __a)
358 template<__detail::__container_compatible_range<value_type> _Rg,
359 __allocator_for<key_container_type, mapped_container_type> _Alloc>
361 _Flat_map_impl(from_range_t, _Rg&& __rg,
const key_compare& __comp,
363 : _Flat_map_impl(__comp, __a)
366 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
368 _Flat_map_impl(initializer_list<value_type> __il,
370 : _Flat_map_impl(__il, key_compare(), __a)
373 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
375 _Flat_map_impl(initializer_list<value_type> __il,
376 const key_compare& __comp,
378 : _Flat_map_impl(__il.begin(), __il.end(), __comp, __a)
381 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
383 _Flat_map_impl(__sorted_t __s,
384 initializer_list<value_type> __il,
386 : _Flat_map_impl(__s, __il.begin(), __il.end(), key_compare(), __a)
389 template<__allocator_for<key_container_type, mapped_container_type> _Alloc>
391 _Flat_map_impl(__sorted_t __s,
392 initializer_list<value_type> __il,
393 const key_compare& __comp,
395 : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp, __a)
400 operator=(initializer_list<value_type> __il)
404 return static_cast<_Derived&
>(*this);
411 {
return {
this, _M_cont.keys.cbegin()}; }
415 begin() const noexcept
416 {
return {
this, _M_cont.keys.cbegin()}; }
421 {
return {
this, _M_cont.keys.cend()}; }
426 {
return {
this, _M_cont.keys.cend()}; }
431 {
return reverse_iterator(end()); }
434 const_reverse_iterator
435 rbegin() const noexcept
436 {
return const_reverse_iterator(end()); }
441 {
return reverse_iterator(begin()); }
444 const_reverse_iterator
445 rend() const noexcept
446 {
return const_reverse_iterator(begin()); }
450 cbegin() const noexcept
451 {
return {
this, _M_cont.keys.cbegin()}; }
455 cend() const noexcept
456 {
return {
this, _M_cont.keys.cend()}; }
459 const_reverse_iterator
460 crbegin() const noexcept
461 {
return const_reverse_iterator(cend()); }
464 const_reverse_iterator
465 crend() const noexcept
466 {
return const_reverse_iterator(cbegin()); }
472 empty() const noexcept
473 {
return _M_cont.keys.empty(); }
477 size() const noexcept
478 {
return _M_cont.keys.size(); }
482 max_size() const noexcept
489 template<
typename _Key2,
typename... _Args>
492 _M_try_emplace(optional<const_iterator> __hint, _Key2&& __k, _Args&&... __args)
495 typename key_container_type::iterator __key_it;
496 typename mapped_container_type::iterator __value_it;
497 int __r = -1, __s = -1;
498 if (__hint.has_value()
499 && (__hint == cbegin()
500 || (__r = !_M_comp(__k, (*__hint)[-1].first)))
502 || (__s = !_M_comp((*__hint)[0].first, __k))))
504 __key_it = _M_cont.keys.begin() + __hint->_M_index;
505 if constexpr (!_Multi)
506 if (__r == 1 && !_M_comp(__key_it[-1], __k))
507 return {iterator{
this, __key_it - 1},
false};
511 auto __first = _M_cont.keys.begin();
512 auto __last = _M_cont.keys.end();
514 __first += __hint->_M_index;
516 __last = __first + __hint->_M_index;
517 if constexpr (_Multi)
521 __key_it = std::lower_bound(__first, __last, __k, _M_comp);
526 __k, std::not_fn(_M_comp)).base();
529 __key_it = std::lower_bound(__first, __last, __k, _M_comp);
532 if constexpr (!_Multi)
533 if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))
534 return {iterator{
this, __key_it},
false};
536 auto __guard = _M_make_clear_guard();
537 __key_it = _M_cont.keys.insert(__key_it,
std::move(__k));
538 __value_it = _M_cont.values.begin() + (__key_it - _M_cont.keys.begin());
540 __guard._M_disable();
541 return {iterator{
this, __key_it},
true};
544 template<
typename... _Args>
545 requires is_constructible_v<value_type, _Args...>
548 emplace(_Args&&... __args)
552 if constexpr (_Multi)
558 template<
typename... _Args>
561 emplace_hint(const_iterator __position, _Args&&... __args)
569 insert(
const value_type& __x)
570 {
return emplace(__x); }
574 insert(value_type&& __x)
579 insert(const_iterator __position,
const value_type& __x)
580 {
return emplace_hint(__position, __x); }
584 insert(const_iterator __position, value_type&& __x)
585 {
return emplace_hint(__position,
std::move(__x)); }
587 template<
typename _Arg>
588 requires is_constructible_v<value_type, _Arg>
594 template<
typename _Arg>
595 requires is_constructible_v<value_type, _Arg>
598 insert(const_iterator __position, _Arg&& __x)
602 template<
typename _Iter,
typename _Sent>
605 _M_insert(_Iter __first, _Sent __last)
612 auto __guard = _M_make_clear_guard();
614 for (; __first != __last; ++__first)
616 value_type __value = *__first;
617 _M_cont.keys.emplace_back(
std::move(__value.first));
618 _M_cont.values.emplace_back(
std::move(__value.second));
620 auto __zv = views::zip(_M_cont.keys, _M_cont.values);
621 ranges::sort(__zv.begin() + __n, __zv.end(), value_comp());
622 ranges::inplace_merge(__zv.begin(), __zv.begin() + __n, __zv.end(), value_comp());
623 if constexpr (!_Multi)
625 __guard._M_cont =
nullptr;
627 auto __guard = _M_make_clear_guard();
628 for (; __first != __last; ++__first)
630 value_type __value = *__first;
631 _M_cont.keys.emplace_back(
std::move(__value.first));
632 _M_cont.values.emplace_back(
std::move(__value.second));
635 __guard._M_disable();
640 template<__has_input_iter_cat _InputIterator>
643 insert(_InputIterator __first, _InputIterator __last)
646 template<__has_input_iter_cat _InputIterator>
649 insert(__sorted_t, _InputIterator __first, _InputIterator __last)
655 template<__detail::__container_compatible_range<value_type> _Rg>
658 insert_range(_Rg&& __rg)
659 { _M_insert(ranges::begin(__rg), ranges::end(__rg)); }
663 insert(initializer_list<value_type> __il)
664 { insert(__il.begin(), __il.end()); }
668 insert(__sorted_t __s, initializer_list<value_type> __il)
669 { insert(__s, __il.begin(), __il.end()); }
675 auto __guard = _M_make_clear_guard();
681 replace(key_container_type&& __key_cont, mapped_container_type&& __mapped_cont)
683 __glibcxx_assert(__key_cont.size() == __mapped_cont.size());
684 _GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(__key_cont, _M_comp));
685 auto __guard = _M_make_clear_guard();
687 _M_cont.values =
std::move(__mapped_cont);
688 __guard._M_disable();
695 erase(iterator __position)
696 {
return erase(
static_cast<const_iterator
>(__position)); }
700 erase(const_iterator __position)
702 auto __guard = _M_make_clear_guard();
703 auto __idx = __position._M_index;
704 auto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __idx);
705 _M_cont.values.erase(_M_cont.values.begin() + __idx);
706 __guard._M_disable();
707 return iterator{
this, __it};
712 erase(
const key_type& __x)
713 {
return erase<const key_type&>(__x); }
715 template<
typename _Key2>
716 requires same_as<remove_cvref_t<_Key2>, _Key>
717 || (__transparent_comparator<_Compare>
718 && !is_convertible_v<_Key2, iterator>
719 && !is_convertible_v<_Key2, const_iterator>)
725 auto __n = __last - __first;
726 erase(__first, __last);
732 erase(const_iterator __first, const_iterator __last)
734 auto __guard = _M_make_clear_guard();
735 auto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __first._M_index,
736 _M_cont.keys.begin() + __last._M_index);
737 _M_cont.values.erase(_M_cont.values.begin() + __first._M_index,
738 _M_cont.values.begin() + __last._M_index);
739 __guard._M_disable();
740 return iterator{
this, __it};
745 swap(_Derived& __y)
noexcept
747 ranges::swap(_M_comp, __y._M_comp);
748 ranges::swap(_M_cont.keys, __y._M_cont.keys);
749 ranges::swap(_M_cont.values, __y._M_cont.values);
756 _M_cont.keys.clear();
757 _M_cont.values.clear();
771 {
return value_compare(_M_comp); }
775 const key_container_type&
776 keys() const noexcept
777 {
return _M_cont.keys; }
781 const mapped_container_type&
782 values() const noexcept
783 {
return _M_cont.values; }
789 find(
const key_type& __x)
790 {
return find<key_type>(__x); }
795 find(
const key_type& __x)
const
796 {
return find<key_type>(__x); }
798 template<
typename _Key2>
799 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
803 find(
const _Key2& __x)
805 auto __it = lower_bound(__x);
806 if (__it != end() && !_M_comp(__x, __it->first))
812 template<
typename _Key2>
813 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
817 find(
const _Key2& __x)
const
819 auto __it = lower_bound(__x);
820 if (__it != cend() && !_M_comp(__x, __it->first))
829 count(
const key_type& __x)
const
830 {
return count<key_type>(__x); }
832 template<
typename _Key2>
833 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
837 count(
const _Key2& __x)
const
839 if constexpr (!_Multi)
840 return contains<_Key2>(__x);
843 auto [__first, __last] = equal_range(__x);
844 return __last - __first;
851 contains(
const key_type& __x)
const
852 {
return contains<key_type>(__x); }
854 template<
typename _Key2>
855 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
859 contains(
const _Key2& __x)
const
860 {
return find(__x) != cend(); }
865 lower_bound(
const key_type& __x)
866 {
return lower_bound<key_type>(__x); }
871 lower_bound(
const key_type& __x)
const
872 {
return lower_bound<key_type>(__x); }
874 template<
typename _Key2>
875 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
879 lower_bound(
const _Key2& __x)
881 auto __it = std::lower_bound(_M_cont.keys.begin(), _M_cont.keys.end(),
886 template<
typename _Key2>
887 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
891 lower_bound(
const _Key2& __x)
const
893 auto __it = std::lower_bound(_M_cont.keys.begin(), _M_cont.keys.end(),
901 upper_bound(
const key_type& __x)
902 {
return upper_bound<key_type>(__x); }
907 upper_bound(
const key_type& __x)
const
908 {
return upper_bound<key_type>(__x); }
910 template<
typename _Key2>
911 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
915 upper_bound(
const _Key2& __x)
917 auto __it = std::upper_bound(_M_cont.keys.begin(), _M_cont.keys.end(),
922 template<
typename _Key2>
923 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
927 upper_bound(
const _Key2& __x)
const
929 auto __it = std::upper_bound(_M_cont.keys.begin(), _M_cont.keys.end(),
936 pair<iterator, iterator>
937 equal_range(
const key_type& __x)
938 {
return equal_range<key_type>(__x); }
942 pair<const_iterator, const_iterator>
943 equal_range(
const key_type& __x)
const
944 {
return equal_range<key_type>(__x); }
946 template<
typename _Key2>
947 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
950 pair<iterator, iterator>
951 equal_range(
const _Key2& __x)
953 auto [__first, __last] = std::equal_range(_M_cont.keys.begin(),
956 return {{
this, __first}, {
this, __last}};
959 template<
typename _Key2>
960 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
963 pair<const_iterator, const_iterator>
964 equal_range(
const _Key2& __x)
const
966 auto [__first, __last] = std::equal_range(_M_cont.keys.begin(),
969 return {{
this, __first}, {
this, __last}};
973 friend _GLIBCXX26_CONSTEXPR
bool
974 operator==(
const _Derived& __x,
const _Derived& __y)
976 return __x._M_cont.keys == __y._M_cont.keys
977 && __x._M_cont.values == __y._M_cont.values;
980 template<
typename _Up = value_type>
982 friend _GLIBCXX26_CONSTEXPR __detail::__synth3way_t<_Up>
983 operator<=>(
const _Derived& __x,
const _Derived& __y)
986 __y.begin(), __y.end(),
987 __detail::__synth3way);
990 friend _GLIBCXX26_CONSTEXPR
void
991 swap(_Derived& __x, _Derived& __y)
noexcept
992 {
return __x.swap(__y); }
994 template<
typename _Predicate>
997 _M_erase_if(_Predicate __pred)
999 auto __guard = _M_make_clear_guard();
1000 auto __zv = views::zip(_M_cont.keys, _M_cont.values);
1001 auto __sr = ranges::remove_if(__zv, __pred,
1002 [](
const auto& __e) {
1003 return const_reference(__e);
1005 auto __erased = __sr.size();
1006 erase(end() - __erased, end());
1007 __guard._M_disable();
1013 [[no_unique_address]] _Compare _M_comp;
1015 _GLIBCXX26_CONSTEXPR
1019 auto __zv = views::zip(_M_cont.keys, _M_cont.values);
1020 ranges::sort(__zv, value_comp());
1021 if constexpr (!_Multi)
1025 _GLIBCXX26_CONSTEXPR
1027 _M_unique()
requires (!_Multi)
1031 _GLIBCXX26_CONSTEXPR
1032 __key_equiv(key_compare __c) : _M_comp(__c) { }
1034 _GLIBCXX26_CONSTEXPR
1036 operator()(const_reference __x, const_reference __y)
const
1037 {
return !_M_comp(__x.first, __y.first) && !_M_comp(__y.first, __x.first); }
1039 [[no_unique_address]] key_compare _M_comp;
1042 auto __zv = views::zip(_M_cont.keys, _M_cont.values);
1043 auto __it = ranges::unique(__zv, __key_equiv(_M_comp)).begin();
1044 auto __n = __it - __zv.begin();
1045 _M_cont.keys.erase(_M_cont.keys.begin() + __n, _M_cont.keys.end());
1046 _M_cont.values.erase(_M_cont.values.begin() + __n, _M_cont.values.end());
1050 template<
typename _Key,
typename _Tp,
typename _Compare,
1051 typename _KeyContainer,
typename _MappedContainer,
bool _Multi>
1052 template<
bool _Const>
1053 class _Flat_map_impl<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer, _Multi>::_Iterator
1055 using __size_type =
typename _Flat_map_impl::size_type;
1058 using iterator_category = input_iterator_tag;
1059 using iterator_concept = random_access_iterator_tag;
1060 using value_type = pair<key_type, mapped_type>;
1061 using reference =
pair<
const key_type&,
1062 ranges::__maybe_const_t<_Const, mapped_type>&>;
1063 using difference_type = ptrdiff_t;
1065 _GLIBCXX26_CONSTEXPR
1066 _Iterator() =
default;
1068 _GLIBCXX26_CONSTEXPR
1069 _Iterator(_Iterator<!_Const> __it)
requires _Const
1070 : _M_cont(__it._M_cont), _M_index(__it._M_index)
1073 _GLIBCXX26_CONSTEXPR
1077 __glibcxx_assert(_M_index < _M_cont->keys.size());
1078 return {_M_cont->keys[_M_index], _M_cont->values[_M_index]};
1085 _GLIBCXX26_CONSTEXPR
1087 operator->() const noexcept
1091 _GLIBCXX26_CONSTEXPR
1096 _GLIBCXX26_CONSTEXPR
1098 operator[](difference_type __n)
const noexcept
1099 {
return *(*
this + __n); }
1101 _GLIBCXX26_CONSTEXPR
1103 operator++() noexcept
1109 _GLIBCXX26_CONSTEXPR
1111 operator--() noexcept
1117 _GLIBCXX26_CONSTEXPR
1119 operator++(
int)
noexcept
1126 _GLIBCXX26_CONSTEXPR
1128 operator--(
int)
noexcept
1135 _GLIBCXX26_CONSTEXPR
1137 operator+=(difference_type __n)
noexcept
1143 _GLIBCXX26_CONSTEXPR
1145 operator-=(difference_type __n)
noexcept
1152 friend _Flat_map_impl;
1153 friend _Iterator<!_Const>;
1155 _GLIBCXX26_CONSTEXPR
1156 _Iterator(_Flat_map_impl* __fm,
typename key_container_type::const_iterator __it)
1158 : _M_cont(std::
__addressof(__fm->_M_cont)), _M_index(__it - __fm->keys().cbegin())
1161 _GLIBCXX26_CONSTEXPR
1162 _Iterator(
const _Flat_map_impl* __fm,
typename key_container_type::const_iterator __it)
1164 : _M_cont(
std::__addressof(__fm->_M_cont)), _M_index(__it - __fm->keys().cbegin())
1167 friend _GLIBCXX26_CONSTEXPR _Iterator
1168 operator+(_Iterator __it, difference_type __n)
noexcept
1174 friend _GLIBCXX26_CONSTEXPR _Iterator
1175 operator+(difference_type __n, _Iterator __it)
noexcept
1181 friend _GLIBCXX26_CONSTEXPR _Iterator
1182 operator-(_Iterator __it, difference_type __n)
noexcept
1188 friend _GLIBCXX26_CONSTEXPR difference_type
1189 operator-(
const _Iterator& __x,
const _Iterator& __y)
noexcept
1191 __glibcxx_assert(__x._M_cont == __y._M_cont);
1192 return __x._M_index - __y._M_index;
1195 friend _GLIBCXX26_CONSTEXPR
bool
1196 operator==(
const _Iterator& __x,
const _Iterator& __y)
noexcept
1198 __glibcxx_assert(__x._M_cont == __y._M_cont);
1199 __glibcxx_assert((__x._M_index ==
size_t(-1)) == (__y._M_index ==
size_t(-1)));
1200 return __x._M_index == __y._M_index;
1203 friend _GLIBCXX26_CONSTEXPR strong_ordering
1204 operator<=>(
const _Iterator& __x,
const _Iterator& __y)
1206 __glibcxx_assert(__x._M_cont == __y._M_cont);
1207 __glibcxx_assert((__x._M_index ==
size_t(-1)) == (__y._M_index ==
size_t(-1)));
1208 return __x._M_index <=> __y._M_index;
1211 ranges::__maybe_const_t<_Const, containers>* _M_cont =
nullptr;
1212 __size_type _M_index = -1;
1219 template<
typename _Key,
typename _Tp,
typename _Compare = less<_Key>,
1220 typename _KeyContainer = vector<_Key>,
1221 typename _MappedContainer = vector<_Tp>>
1223 :
private _Flat_map_impl<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer, false>
1225 using _Impl = _Flat_map_impl<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer, false>;
1230 using typename _Impl::key_type;
1231 using typename _Impl::mapped_type;
1232 using typename _Impl::value_type;
1233 using typename _Impl::key_compare;
1234 using typename _Impl::reference;
1235 using typename _Impl::const_reference;
1236 using typename _Impl::size_type;
1237 using typename _Impl::difference_type;
1238 using typename _Impl::iterator;
1239 using typename _Impl::const_iterator;
1240 using typename _Impl::reverse_iterator;
1241 using typename _Impl::const_reverse_iterator;
1242 using typename _Impl::key_container_type;
1243 using typename _Impl::mapped_container_type;
1244 using typename _Impl::value_compare;
1245 using typename _Impl::containers;
1253 using _Impl::rbegin;
1256 using _Impl::cbegin;
1258 using _Impl::crbegin;
1264 using _Impl::max_size;
1267 _GLIBCXX26_CONSTEXPR
1269 operator[](
const key_type& __x)
1270 {
return try_emplace(__x).first->second; }
1272 _GLIBCXX26_CONSTEXPR
1274 operator[](key_type&& __x)
1275 {
return try_emplace(
std::move(__x)).first->second; }
1277 template<
typename _Key2>
1278 requires __transparent_comparator<_Compare>
1279 _GLIBCXX26_CONSTEXPR
1281 operator[](_Key2&& __x)
1284 _GLIBCXX26_CONSTEXPR
1286 at(
const key_type& __x)
1287 {
return at<key_type>(__x); }
1289 _GLIBCXX26_CONSTEXPR
1291 at(
const key_type& __x)
const
1292 {
return at<key_type>(__x); }
1294 template<
typename _Key2>
1295 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
1296 _GLIBCXX26_CONSTEXPR
1298 at(
const _Key2& __x)
1300 auto __it = this->find(__x);
1301 if (__it == this->end())
1302 __throw_out_of_range(
"flat_map::at");
1303 return __it->second;
1306 template<
typename _Key2>
1307 requires same_as<_Key2, _Key> || __transparent_comparator<_Compare>
1308 _GLIBCXX26_CONSTEXPR
1310 at(
const _Key2& __x)
const
1312 auto __it = this->find(__x);
1313 if (__it == this->end())
1314 __throw_out_of_range(
"flat_map::at");
1315 return __it->second;
1319 using _Impl::emplace;
1320 using _Impl::emplace_hint;
1321 using _Impl::insert;
1322 using _Impl::insert_range;
1323 using _Impl::extract;
1324 using _Impl::replace;
1329 template<
typename... _Args>
1330 requires is_constructible_v<mapped_type, _Args...>
1331 _GLIBCXX26_CONSTEXPR
1332 pair<iterator, bool>
1333 try_emplace(
const key_type& __k, _Args&&... __args)
1336 template<
typename... _Args>
1337 requires is_constructible_v<mapped_type, _Args...>
1338 _GLIBCXX26_CONSTEXPR
1339 pair<iterator, bool>
1340 try_emplace(key_type&& __k, _Args&&... __args)
1342 return _Impl::_M_try_emplace(nullopt,
std::move(__k),
1346 template<
typename _Key2,
typename... _Args>
1347 requires __transparent_comparator<_Compare>
1348 && is_constructible_v<key_type, _Key2>
1349 && is_constructible_v<mapped_type, _Args...>
1350 && (!is_convertible_v<_Key2&&, const_iterator>)
1351 && (!is_convertible_v<_Key2&&, iterator>)
1352 _GLIBCXX26_CONSTEXPR
1353 pair<iterator, bool>
1354 try_emplace(_Key2&& __k, _Args&&... __args)
1360 template<
typename... _Args>
1361 requires is_constructible_v<mapped_type, _Args...>
1362 _GLIBCXX26_CONSTEXPR
1364 try_emplace(const_iterator __hint,
const key_type& __k, _Args&&... __args)
1367 template<
typename... _Args>
1368 requires is_constructible_v<mapped_type, _Args...>
1369 _GLIBCXX26_CONSTEXPR
1371 try_emplace(const_iterator __hint, key_type&& __k, _Args&&... __args)
1373 return _Impl::_M_try_emplace(__hint,
std::move(__k),
1377 template<
typename _Key2,
typename... _Args>
1378 requires __transparent_comparator<_Compare>
1379 && is_constructible_v<key_type, _Key2>
1380 && is_constructible_v<mapped_type, _Args...>
1381 _GLIBCXX26_CONSTEXPR
1383 try_emplace(const_iterator __hint, _Key2&& __k, _Args&&... __args)
1389 template<
typename _Mapped>
1390 requires is_assignable_v<mapped_type&, _Mapped>
1391 && is_constructible_v<mapped_type, _Mapped>
1392 _GLIBCXX26_CONSTEXPR
1393 pair<iterator, bool>
1394 insert_or_assign(
const key_type& __k, _Mapped&& __obj)
1397 template<
typename _Mapped>
1398 requires is_assignable_v<mapped_type&, _Mapped>
1399 && is_constructible_v<mapped_type, _Mapped>
1400 _GLIBCXX26_CONSTEXPR
1401 pair<iterator, bool>
1402 insert_or_assign(key_type&& __k, _Mapped&& __obj)
1404 return insert_or_assign<key_type, _Mapped>(
std::move(__k),
1408 template<
typename _Key2,
typename _Mapped>
1409 requires (same_as<remove_cvref_t<_Key2>, _Key> || __transparent_comparator<_Compare>)
1410 && is_constructible_v<key_type, _Key2>
1411 && is_assignable_v<mapped_type&, _Mapped>
1412 && is_constructible_v<mapped_type, _Mapped>
1413 _GLIBCXX26_CONSTEXPR
1414 pair<iterator, bool>
1415 insert_or_assign(_Key2&& __k, _Mapped&& __obj)
1424 template<
typename _Mapped>
1425 requires is_assignable_v<mapped_type&, _Mapped>
1426 && is_constructible_v<mapped_type, _Mapped>
1427 _GLIBCXX26_CONSTEXPR
1429 insert_or_assign(const_iterator __hint,
const key_type& __k, _Mapped&& __obj)
1431 return insert_or_assign<const key_type&, _Mapped>(__hint, __k,
1435 template<
typename _Mapped>
1436 requires is_assignable_v<mapped_type&, _Mapped>
1437 && is_constructible_v<mapped_type, _Mapped>
1438 _GLIBCXX26_CONSTEXPR
1440 insert_or_assign(const_iterator __hint, key_type&& __k, _Mapped&& __obj)
1442 return insert_or_assign<key_type, _Mapped>(__hint,
std::move(__k),
1446 template<
typename _Key2,
typename _Mapped>
1447 requires (same_as<remove_cvref_t<_Key2>, _Key> || __transparent_comparator<_Compare>)
1448 && is_constructible_v<key_type, _Key2>
1449 && is_assignable_v<mapped_type&, _Mapped>
1450 && is_constructible_v<mapped_type, _Mapped>
1451 _GLIBCXX26_CONSTEXPR
1453 insert_or_assign(const_iterator __hint, _Key2&& __k, _Mapped&& __obj)
1463 using _Impl::key_comp;
1464 using _Impl::value_comp;
1466 using _Impl::values;
1471 using _Impl::contains;
1472 using _Impl::lower_bound;
1473 using _Impl::upper_bound;
1474 using _Impl::equal_range;
1476 using _Impl::_M_erase_if;
1479 template<
typename _KeyContainer,
typename _MappedContainer,
1481 flat_map(_KeyContainer, _MappedContainer, _Compare = _Compare())
1482 -> flat_map<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1483 _Compare, _KeyContainer, _MappedContainer>;
1485 template<
typename _KeyContainer,
typename _MappedContainer,
1486 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1487 flat_map(_KeyContainer, _MappedContainer, _Alloc)
1488 -> flat_map<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1491 template<
typename _KeyContainer,
typename _MappedContainer, __not_allocator_like _Compare,
1492 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1493 flat_map(_KeyContainer, _MappedContainer, _Compare, _Alloc)
1494 -> flat_map<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1495 _Compare, _KeyContainer, _MappedContainer>;
1497 template<
typename _KeyContainer,
typename _MappedContainer,
1499 flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare = _Compare())
1500 -> flat_map<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1501 _Compare, _KeyContainer, _MappedContainer>;
1503 template<
typename _KeyContainer,
typename _MappedContainer,
1504 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1505 flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Alloc)
1506 -> flat_map<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1509 template<
typename _KeyContainer,
typename _MappedContainer, __not_allocator_like _Compare,
1510 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1511 flat_map(sorted_unique_t, _KeyContainer, _MappedContainer, _Compare, _Alloc)
1512 -> flat_map<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1513 _Compare, _KeyContainer, _MappedContainer>;
1515 template<__has_input_iter_cat _InputIterator,
1517 flat_map(_InputIterator, _InputIterator, _Compare = _Compare())
1518 -> flat_map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Compare>;
1520 template<__has_input_iter_cat _InputIterator,
1522 flat_map(sorted_unique_t, _InputIterator, _InputIterator, _Compare = _Compare())
1523 -> flat_map<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Compare>;
1528 flat_map(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc())
1529 -> flat_map<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>,
1532 __alloc_rebind<_Alloc, __detail::__range_key_type<_Rg>>>,
1534 __alloc_rebind<_Alloc, __detail::__range_mapped_type<_Rg>>>>;
1536 template<ranges::input_range _Rg, __allocator_like _Alloc>
1537 flat_map(from_range_t, _Rg&&, _Alloc)
1538 -> flat_map<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>,
1541 __alloc_rebind<_Alloc, __detail::__range_key_type<_Rg>>>,
1543 __alloc_rebind<_Alloc, __detail::__range_mapped_type<_Rg>>>>;
1545 template<
typename _Key,
typename _Tp, __not_allocator_like _Compare = less<_Key>>
1547 -> flat_map<_Key, _Tp, _Compare>;
1549 template<
typename _Key,
typename _Tp, __not_allocator_like _Compare = less<_Key>>
1551 -> flat_map<_Key, _Tp, _Compare>;
1553 template<
typename _Key,
typename _Tp,
typename _Compare,
1554 typename _KeyContainer,
typename _MappedContainer,
typename _Alloc>
1555 struct uses_allocator<flat_map<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>, _Alloc>
1556 : bool_constant<uses_allocator_v<_KeyContainer, _Alloc>
1557 && uses_allocator_v<_MappedContainer, _Alloc>>
1560 template<
typename _Key,
typename _Tp,
typename _Compare,
1561 typename _KeyContainer,
typename _MappedContainer,
typename _Predicate>
1562 _GLIBCXX26_CONSTEXPR
1563 typename flat_map<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>::size_type
1564 erase_if(flat_map<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>& __c,
1566 {
return __c._M_erase_if(
std::move(__pred)); }
1572 template<
typename _Key,
typename _Tp,
typename _Compare = less<_Key>,
1573 typename _KeyContainer = vector<_Key>,
1574 typename _MappedContainer = vector<_Tp>>
1576 :
private _Flat_map_impl<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer, true>
1578 using _Impl = _Flat_map_impl<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer, true>;
1583 using typename _Impl::key_type;
1584 using typename _Impl::mapped_type;
1585 using typename _Impl::value_type;
1586 using typename _Impl::key_compare;
1587 using typename _Impl::reference;
1588 using typename _Impl::const_reference;
1589 using typename _Impl::size_type;
1590 using typename _Impl::difference_type;
1591 using typename _Impl::iterator;
1592 using typename _Impl::const_iterator;
1593 using typename _Impl::reverse_iterator;
1594 using typename _Impl::const_reverse_iterator;
1595 using typename _Impl::key_container_type;
1596 using typename _Impl::mapped_container_type;
1597 using typename _Impl::value_compare;
1598 using typename _Impl::containers;
1606 using _Impl::rbegin;
1609 using _Impl::cbegin;
1611 using _Impl::crbegin;
1617 using _Impl::max_size;
1620 using _Impl::emplace;
1621 using _Impl::emplace_hint;
1622 using _Impl::insert;
1623 using _Impl::insert_range;
1624 using _Impl::extract;
1625 using _Impl::replace;
1631 using _Impl::key_comp;
1632 using _Impl::value_comp;
1634 using _Impl::values;
1639 using _Impl::contains;
1640 using _Impl::lower_bound;
1641 using _Impl::upper_bound;
1642 using _Impl::equal_range;
1644 using _Impl::_M_erase_if;
1647 template<
typename _KeyContainer,
typename _MappedContainer,
1649 flat_multimap(_KeyContainer, _MappedContainer, _Compare = _Compare())
1650 -> flat_multimap<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1651 _Compare, _KeyContainer, _MappedContainer>;
1653 template<
typename _KeyContainer,
typename _MappedContainer,
1654 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1655 flat_multimap(_KeyContainer, _MappedContainer, _Alloc)
1656 -> flat_multimap<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1659 template<
typename _KeyContainer,
typename _MappedContainer, __not_allocator_like _Compare,
1660 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1661 flat_multimap(_KeyContainer, _MappedContainer, _Compare, _Alloc)
1662 -> flat_multimap<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1663 _Compare, _KeyContainer, _MappedContainer>;
1665 template<
typename _KeyContainer,
typename _MappedContainer,
1667 flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare = _Compare())
1668 -> flat_multimap<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1669 _Compare, _KeyContainer, _MappedContainer>;
1671 template<
typename _KeyContainer,
typename _MappedContainer,
1672 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1673 flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Alloc)
1674 -> flat_multimap<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1677 template<
typename _KeyContainer,
typename _MappedContainer, __not_allocator_like _Compare,
1678 __allocator_for<_KeyContainer, _MappedContainer> _Alloc>
1679 flat_multimap(sorted_equivalent_t, _KeyContainer, _MappedContainer, _Compare, _Alloc)
1680 -> flat_multimap<
typename _KeyContainer::value_type,
typename _MappedContainer::value_type,
1681 _Compare, _KeyContainer, _MappedContainer>;
1683 template<__has_input_iter_cat _InputIterator,
1685 flat_multimap(_InputIterator, _InputIterator, _Compare = _Compare())
1686 -> flat_multimap<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Compare>;
1688 template<__has_input_iter_cat _InputIterator,
1690 flat_multimap(sorted_equivalent_t, _InputIterator, _InputIterator, _Compare = _Compare())
1691 -> flat_multimap<__iter_key_t<_InputIterator>, __iter_val_t<_InputIterator>, _Compare>;
1696 flat_multimap(from_range_t, _Rg&&, _Compare = _Compare(), _Alloc = _Alloc())
1697 -> flat_multimap<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>,
1700 __alloc_rebind<_Alloc, __detail::__range_key_type<_Rg>>>,
1702 __alloc_rebind<_Alloc, __detail::__range_mapped_type<_Rg>>>>;
1704 template<ranges::input_range _Rg, __allocator_like _Alloc>
1705 flat_multimap(from_range_t, _Rg&&, _Alloc)
1706 -> flat_multimap<__detail::__range_key_type<_Rg>, __detail::__range_mapped_type<_Rg>,
1709 __alloc_rebind<_Alloc, __detail::__range_key_type<_Rg>>>,
1711 __alloc_rebind<_Alloc, __detail::__range_mapped_type<_Rg>>>>;
1713 template<
typename _Key,
typename _Tp, __not_allocator_like _Compare = less<_Key>>
1715 -> flat_multimap<_Key, _Tp, _Compare>;
1717 template<
typename _Key,
typename _Tp, __not_allocator_like _Compare = less<_Key>>
1719 -> flat_multimap<_Key, _Tp, _Compare>;
1721 template<
typename _Key,
typename _Tp,
typename _Compare,
1722 typename _KeyContainer,
typename _MappedContainer,
typename _Alloc>
1723 struct uses_allocator<flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>,
1725 : bool_constant<uses_allocator_v<_KeyContainer, _Alloc>
1726 && uses_allocator_v<_MappedContainer, _Alloc>>
1729 template<
typename _Key,
typename _Tp,
typename _Compare,
1730 typename _KeyContainer,
typename _MappedContainer,
typename _Predicate>
1731 _GLIBCXX26_CONSTEXPR
1732 typename flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>::size_type
1733 erase_if(flat_multimap<_Key, _Tp, _Compare, _KeyContainer, _MappedContainer>& __c,
1735 {
return __c._M_erase_if(
std::move(__pred)); }
1737_GLIBCXX_END_NAMESPACE_VERSION
constexpr complex< _Tp > operator*(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x times y.
constexpr complex< _Tp > operator-(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x minus y.
constexpr complex< _Tp > operator+(const complex< _Tp > &__x, const complex< _Tp > &__y)
Return new complex value x plus y.
pair(_T1, _T2) -> pair< _T1, _T2 >
Two pairs are equal iff their members are equal.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr _Tp * __addressof(_Tp &__r) noexcept
Same as C++11 std::addressof.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
constexpr auto lexicographical_compare_three_way(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Comp __comp) -> decltype(__comp(*__first1, *__first2))
Performs dictionary comparison on ranges.
constexpr const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
constexpr reverse_iterator< _Iterator > make_reverse_iterator(_Iterator __i)
Generator function for reverse_iterator.
ISO C++ entities toplevel namespace is std.
The standard allocator, as per C++03 [20.4.1].
Declare uses_allocator so it can be specialized in <queue> etc.
One of the comparison functors.
Struct holding two objects of arbitrary type.
A standard container which offers fixed time access to individual elements in any order.
A range for which ranges::begin returns an input iterator.