62#pragma GCC system_header
71#if __cplusplus >= 201103L
74#ifdef __glibcxx_node_extract
78#if __cplusplus < 201103L
79# undef _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
80# define _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE 0
81#elif ! defined _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
82# define _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE 1
119 while (__x->_M_left != 0) __x = __x->_M_left;
126 while (__x->_M_right != 0) __x = __x->_M_right;
139 template<
typename _Key_compare>
145 _GLIBCXX_NOEXCEPT_IF(
154#if __cplusplus >= 201103L
177#if __cplusplus >= 201103L
180 if (__x._M_header._M_parent !=
nullptr)
213 template<
typename _Val>
216#if __cplusplus < 201103L
243#if _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
246 template<
typename _Vo
idPtr>
259 while (__x->_M_left) __x = __x->_M_left;
266 while (__x->_M_right) __x = __x->_M_right;
282 template<
typename _NodeBase>
300 if (__x._M_header._M_parent)
331 template<
typename _ValPtr>
365 _GLIBCXX_PURE _Rb_tree_node_base*
371 template<
typename _Tp>
432 {
return __x._M_node == __y._M_node; }
434#if ! __cpp_lib_three_way_comparison
438 {
return __x._M_node != __y._M_node; }
444 template<
typename _Tp>
510 {
return __x._M_node == __y._M_node; }
512#if ! __cpp_lib_three_way_comparison
516 {
return __x._M_node != __y._M_node; }
522 __attribute__((__nonnull__))
529 __attribute__((__nonnull__,__returns_nonnull__))
536#if _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
537 template<
bool _Const,
typename _ValPtr>
540 template<
typename _Tp>
565#ifdef __glibcxx_concepts
569 template<
bool _OtherConst,
579 {
return *
static_cast<_Node&
>(*_M_node)._M_valptr(); }
584 {
return static_cast<_Node&
>(*_M_node)._M_valptr(); }
598 while (
_M_node == __y->_M_right)
601 __y = __y->_M_parent;
627 while (__y->_M_right)
634 while (
_M_node == __y->_M_left)
637 __y = __y->_M_parent;
655 {
return __x._M_node == __y._M_node; }
657#if ! __cpp_lib_three_way_comparison
661 {
return __x._M_node != __y._M_node; }
669 template<
typename _Val,
typename _Ptr>
672#if _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE <= 9000
676 template<
typename _Val>
687 __attribute__((__nonnull__))
696 __attribute__((__nonnull__,__returns_nonnull__))
704#if ! _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
706 template<
typename _Val,
typename _Ptr>
708 : _Node_traits<_Val, _Val*>
712 template<
typename _Val,
typename _ValPtr>
728 __x->_M_right = __y->_M_left;
730 __y->_M_left->_M_parent = __x;
731 __y->_M_parent = __x->_M_parent;
735 else if (__x == __x->_M_parent->_M_left)
736 __x->_M_parent->_M_left = __y;
738 __x->_M_parent->_M_right = __y;
740 __x->_M_parent = __y;
748 __x->_M_left = __y->_M_right;
750 __y->_M_right->_M_parent = __x;
751 __y->_M_parent = __x->_M_parent;
755 else if (__x == __x->_M_parent->_M_right)
756 __x->_M_parent->_M_right = __y;
758 __x->_M_parent->_M_left = __y;
760 __x->_M_parent = __y;
771 __x->_M_parent = __p;
772 __x->_M_left = __x->_M_right =
nullptr;
788 else if (__p == __header.
_M_left)
800 && __x->_M_parent->_M_color ==
_S_red)
802 const _Base_ptr __xpp = __x->_M_parent->_M_parent;
804 if (__x->_M_parent == __xpp->_M_left)
807 if (__y && __y->_M_color ==
_S_red)
809 __x->_M_parent->_M_color =
_S_black;
816 if (__x == __x->_M_parent->_M_right)
818 __x = __x->_M_parent;
821 __x->_M_parent->_M_color =
_S_black;
829 if (__y && __y->_M_color ==
_S_red)
831 __x->_M_parent->_M_color =
_S_black;
838 if (__x == __x->_M_parent->_M_left)
840 __x = __x->_M_parent;
843 __x->_M_parent->_M_color =
_S_black;
878 __z->_M_left->_M_parent = __y;
879 __y->_M_left = __z->_M_left;
880 if (__y != __z->_M_right)
882 __x_parent = __y->_M_parent;
884 __x->_M_parent = __y->_M_parent;
885 __y->_M_parent->_M_left = __x;
886 __y->_M_right = __z->_M_right;
887 __z->_M_right->_M_parent = __y;
893 else if (__z->_M_parent->_M_left == __z)
894 __z->_M_parent->_M_left = __y;
896 __z->_M_parent->_M_right = __y;
897 __y->_M_parent = __z->_M_parent;
904 __x_parent = __y->_M_parent;
906 __x->_M_parent = __y->_M_parent;
910 if (__z->_M_parent->_M_left == __z)
911 __z->_M_parent->_M_left = __x;
913 __z->_M_parent->_M_right = __x;
914 if (__leftmost == __z)
917 __leftmost = __z->_M_parent;
922 if (__rightmost == __z)
924 if (__z->_M_left == 0)
925 __rightmost = __z->_M_parent;
931 if (__y->_M_color !=
_S_red)
933 while (__x != __root && (__x == 0 || __x->_M_color ==
_S_black))
934 if (__x == __x_parent->_M_left)
937 if (__w->_M_color ==
_S_red)
940 __x_parent->_M_color =
_S_red;
942 __w = __x_parent->_M_right;
944 if ((!__w->_M_left || __w->_M_left->_M_color ==
_S_black) &&
945 (!__w->_M_right || __w->_M_right->_M_color ==
_S_black))
949 __x_parent = __x_parent->_M_parent;
953 if (!__w->_M_right || __w->_M_right->_M_color ==
_S_black)
958 __w = __x_parent->_M_right;
960 __w->_M_color = __x_parent->_M_color;
972 if (__w->_M_color ==
_S_red)
975 __x_parent->_M_color =
_S_red;
977 __w = __x_parent->_M_left;
979 if ((!__w->_M_right || __w->_M_right->_M_color ==
_S_black) &&
980 (!__w->_M_left || __w->_M_left->_M_color ==
_S_black))
984 __x_parent = __x_parent->_M_parent;
988 if (!__w->_M_left || __w->_M_left->_M_color ==
_S_black)
993 __w = __x_parent->_M_left;
995 __w->_M_color = __x_parent->_M_color;
1013#ifdef __glibcxx_node_extract
1014 template<
typename _Tree1,
typename _Cmp2>
1015 struct _Rb_tree_merge_helper { };
1018 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
1060#if __cplusplus >= 201103L
1067 _M_t._M_erase(
static_cast<_Node&
>(*_M_root)._M_node_ptr());
1070 template<
typename _Arg>
1078 _M_t._M_destroy_node(__node);
1133 template<
typename _Arg>
1157 const _Node_allocator&
1169#if __cplusplus < 201102L || _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
1172#pragma GCC diagnostic push
1173#pragma GCC diagnostic ignored "-Wc++17-extensions"
1181 return std::__to_address(__ptr);
1183#pragma GCC diagnostic pop
1190#if __cplusplus < 201102L || _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
1193#pragma GCC diagnostic push
1194#pragma GCC diagnostic ignored "-Wc++17-extensions"
1205#pragma GCC diagnostic pop
1209#if __cplusplus < 201103L
1230 template<
typename... _Args>
1238 __node->_M_valptr(),
1249 template<
typename... _Args>
1262#if __cplusplus < 201103L
1277 template<
bool _MoveValue,
typename _NodeGen>
1281#if __cplusplus >= 201103L
1288 __tmp->_M_color = __x->_M_color;
1289 __tmp->_M_left = __tmp->_M_right =
_Base_ptr();
1296#if _GLIBCXX_INLINE_VERSION
1297 template<
typename _Key_compare>
1300 template<
typename _Key_compare,
1301 bool = __is_pod(_Key_compare)>
1311 _GLIBCXX_NOEXCEPT_IF(
1323#if __cplusplus < 201103L
1354 {
return this->_M_impl._M_header._M_parent; }
1358 {
return this->_M_impl._M_header._M_parent; }
1362 {
return this->_M_impl._M_header._M_left; }
1366 {
return this->_M_impl._M_header._M_left; }
1370 {
return this->_M_impl._M_header._M_right; }
1374 {
return this->_M_impl._M_header._M_right; }
1378 {
return this->_M_impl._M_header._M_parent; }
1383 _Base_ptr __begin = this->_M_impl._M_header._M_parent;
1385 ?
static_cast<_Node&
>(*__begin)._M_node_ptr()
1391 {
return this->_M_impl._M_header._M_base_ptr(); }
1395 template<
typename _Key1,
typename _Key2>
1399#if __cplusplus >= 201103L
1402 __is_invocable<const _Compare&, const _Key&, const _Key&>::value,
1403 "comparison object must be invocable with arguments of key_type"
1406 return _M_impl._M_key_compare(__k1, __k2);
1411 {
return _KeyOfValue()(*__node.
_M_valptr()); }
1415 {
return _S_key(
static_cast<const _Node&
>(*__x)); }
1423 {
return __x->_M_left; }
1429 ?
static_cast<_Node&
>(*__x->_M_left)._M_node_ptr()
1435 {
return __x->_M_right; }
1440 return __x->_M_right
1441 ?
static_cast<_Node&
>(*__x->_M_right)._M_node_ptr()
1452#ifdef __glibcxx_node_extract
1453 using node_type = _Node_handle<_Key, _Val, _Node_allocator>;
1454 using insert_return_type = _Node_insert_return<
1473#ifdef __glibcxx_associative_heterogeneous_insertion
1474 template <
typename... _Args>
1476 _M_emplace_here(
bool __place_left,
_Base_ptr __node, _Args&&... __args);
1478 template <
typename _Kt>
1480 _M_get_insert_unique_pos_tr(
const _Kt& __k);
1482 template <
typename _Kt>
1484 _M_get_insert_hint_unique_pos_tr(
const_iterator,
const _Kt& __k);
1488#if __cplusplus >= 201103L
1489 template<
typename _Arg,
typename _NodeGen>
1496 template<
typename _Arg>
1500 template<
typename _Arg>
1510 template<
typename _NodeGen>
1526 template<
bool _MoveValues,
typename _NodeGen>
1530 template<
bool _MoveValues,
typename _NodeGen>
1545 _Alloc_node __an(*
this);
1554 const _Key& __k)
const;
1556 template <
typename _Kt>
1562 const _Key& __k)
const;
1564 template <
typename _Kt>
1570#if __cplusplus < 201103L
1587#if __cplusplus >= 201103L
1637 {
return _M_impl._M_key_compare; }
1641 {
return iterator(this->_M_impl._M_header._M_left); }
1673 {
return _M_impl._M_node_count == 0; }
1677 {
return _M_impl._M_node_count; }
1685 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value);
1688#if __cplusplus >= 201103L
1689 template<
typename _Arg>
1693 template<
typename _Arg>
1697 template<
typename _Arg,
typename _NodeGen>
1701 template<
typename _Arg>
1705 _Alloc_node __an(*
this);
1709 template<
typename _Arg,
typename _NodeGen>
1713 template<
typename _Arg>
1717 _Alloc_node __an(*
this);
1721 template<
typename... _Args>
1725 template<
typename... _Args>
1729 template<
typename... _Args>
1733 template<
typename... _Args>
1737 template<
typename _Iter>
1741 template<
typename _InputIterator>
1745 _Alloc_node __an(*
this);
1746 for (; __first !=
__last; ++__first)
1750 template<
typename _InputIterator>
1754 for (; __first !=
__last; ++__first)
1758 template<
typename _InputIterator>
1762 _Alloc_node __an(*
this);
1763 for (; __first !=
__last; ++__first)
1767 template<
typename _InputIterator>
1771 for (; __first !=
__last; ++__first)
1781 template<
typename _NodeGen>
1789 _Alloc_node __an(*
this);
1793 template<
typename _NodeGen>
1800 _Alloc_node __an(*
this);
1804 template<
typename _InputIterator>
1809 for (; __first !=
__last; ++__first)
1813 template<
typename _InputIterator>
1818 for (; __first !=
__last; ++__first)
1831#if __cplusplus >= 201103L
1865 erase(const_iterator __position)
1875 template <
typename _Kt>
1882#if __cplusplus >= 201103L
1898 erase(const_iterator __first, const_iterator
__last)
1903 clear() _GLIBCXX_NOEXCEPT
1947#ifdef __glibcxx_generic_associative_lookup
1948 template<
typename _Kt,
1951 _M_find_tr(
const _Kt& __k)
1953 const _Rb_tree* __const_this =
this;
1954 return iterator(__const_this->_M_find_tr(__k)._M_node);
1957 template<
typename _Kt,
1960 _M_find_tr(
const _Kt& __k)
const
1968 template<
typename _Kt,
1971 _M_count_tr(
const _Kt& __k)
const
1973 auto __p = _M_equal_range_tr(__k);
1977 template<
typename _Kt,
1995 template<
typename _Kt,
2013 template<
typename _Kt,
2016 _M_equal_range_tr(
const _Kt& __k)
2018 const _Rb_tree* __const_this =
this;
2019 auto __ret = __const_this->_M_equal_range_tr(__k);
2024 template<
typename _Kt,
2027 _M_equal_range_tr(
const _Kt& __k)
const
2030 auto __high = __low;
2031 auto& __cmp =
_M_impl._M_key_compare;
2032 while (__high !=
end() && !__cmp(__k,
_S_key(__high._M_node)))
2034 return { __low, __high };
2042#if __cplusplus >= 201103L
2048 template<typename _Iterator>
2052 template<typename _Iterator>
2060 {
_M_impl._M_move_data(__x._M_impl); }
2077#ifdef __glibcxx_node_extract
2081#if _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
2084#pragma GCC diagnostic push
2085#pragma GCC diagnostic ignored "-Wc++17-extensions"
2090 return std::__to_address(__ptr);
2091#pragma GCC diagnostic pop
2098 _M_reinsert_node_unique(node_type&& __nh)
2100 insert_return_type __ret;
2102 __ret.position =
end();
2112 _S_adapt(__nh._M_ptr));
2114 __ret.inserted =
true;
2119 __ret.position =
iterator(__res.first);
2120 __ret.inserted =
false;
2128 _M_reinsert_node_equal(node_type&& __nh)
2139 _S_adapt(__nh._M_ptr));
2149 _M_reinsert_node_hint_unique(
const_iterator __hint, node_type&& __nh)
2161 _S_adapt(__nh._M_ptr));
2172 _M_reinsert_node_hint_equal(
const_iterator __hint, node_type&& __nh)
2183 _S_adapt(__nh._M_ptr));
2196 (__pos._M_node,
_M_impl._M_header);
2198 auto __node_ptr =
static_cast<_Node&
>(*__ptr)._M_node_ptr();
2199#if _GLIBCXX_USE_ALLOC_PTR_FOR_RB_TREE
2202#pragma GCC diagnostic push
2203#pragma GCC diagnostic ignored "-Wc++17-extensions"
2205 if constexpr (is_same<_Node_ptr, __alloc_ptr>::value)
2212#pragma GCC diagnostic pop
2221 auto __pos =
find(__k);
2227 template <
typename _Kt>
2229 _M_extract_tr(
const _Kt& __k)
2232 auto __pos = _M_find_tr(__k);
2238 template<
typename _Compare2>
2239 using _Compatible_tree
2242 template<
typename,
typename>
2243 friend struct _Rb_tree_merge_helper;
2246 template<
typename _Compare2>
2248 _M_merge_unique(_Compatible_tree<_Compare2>& __src)
noexcept
2250 using _Merge_helper = _Rb_tree_merge_helper<_Rb_tree, _Compare2>;
2251 for (
auto __i = __src.begin(), __end = __src.end(); __i != __end;)
2257 auto& __src_impl = _Merge_helper::_S_get_impl(__src);
2259 (__pos._M_node, __src_impl._M_header);
2260 --__src_impl._M_node_count;
2261 auto __node_ptr =
static_cast<_Node&
>(*__ptr)._M_node_ptr();
2268 template<
typename _Compare2>
2270 _M_merge_equal(_Compatible_tree<_Compare2>& __src)
noexcept
2272 using _Merge_helper = _Rb_tree_merge_helper<_Rb_tree, _Compare2>;
2273 for (
auto __i = __src.begin(), __end = __src.end(); __i != __end;)
2279 auto& __src_impl = _Merge_helper::_S_get_impl(__src);
2281 (__pos._M_node, __src_impl._M_header);
2282 --__src_impl._M_node_count;
2283 auto __node_ptr =
static_cast<_Node&
>(*__ptr)._M_node_ptr();
2297#if __cpp_lib_three_way_comparison
2301 if constexpr (
requires {
typename __detail::__synth3way_t<_Val>; })
2304 __detail::__synth3way);
2316#if __cplusplus >= 201103L
2320 template<
typename... _Args>
2334 { __n._M_node =
nullptr; }
2351 auto __it =
_M_t._M_insert_equal_lower_node(
_M_node);
2362 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2363 typename _Compare,
typename _Alloc>
2369#if __cplusplus >= 201103L
2370 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2371 typename _Compare,
typename _Alloc>
2383#pragma GCC diagnostic push
2384#pragma GCC diagnostic ignored "-Wc++17-extensions"
2385 if constexpr (__move)
2387#pragma GCC diagnostic pop
2391 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2392 typename _Compare,
typename _Alloc>
2404 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2405 typename _Compare,
typename _Alloc>
2424 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2425 typename _Compare,
typename _Alloc>
2438 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2439 typename _Compare,
typename _Alloc>
2440 template<
typename _Iterator>
2447 for (; __first !=
__last; ++__first)
2451 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2452 typename _Compare,
typename _Alloc>
2453 template<
typename _Iterator>
2460 for (; __first !=
__last; ++__first)
2465 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2466 typename _Compare,
typename _Alloc>
2474#if __cplusplus >= 201103L
2480 && __this_alloc != __that_alloc)
2485 std::__alloc_on_copy(__this_alloc, __that_alloc);
2500 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2501 typename _Compare,
typename _Alloc>
2502#if __cplusplus >= 201103L
2503 template<
typename _Arg,
typename _NodeGen>
2505 template<
typename _NodeGen>
2510#
if __cplusplus >= 201103L
2515 _NodeGen& __node_gen)
2517 bool __insert_left = (__x || __p ==
_M_end()
2525 (__insert_left, __z, __p, this->_M_impl._M_header);
2530 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2531 typename _Compare,
typename _Alloc>
2532#if __cplusplus >= 201103L
2533 template<
typename _Arg>
2537#if __cplusplus >= 201103L
2543 bool __insert_left = (__p ==
_M_end()
2545 _KeyOfValue()(__v)));
2550 (__insert_left, __z, __p, this->_M_impl._M_header);
2555 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2556 typename _Compare,
typename _Alloc>
2557#if __cplusplus >= 201103L
2558 template<
typename _Arg>
2562#if __cplusplus >= 201103L
2579 template<
typename _Key,
typename _Val,
typename _KoV,
2580 typename _Compare,
typename _Alloc>
2581 template<
bool _MoveValues,
typename _NodeGen>
2588 _Base_ptr __top_base = __top->_M_base_ptr();
2589 __top->_M_parent = __p;
2604 __y->_M_parent = __p;
2620 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2621 typename _Compare,
typename _Alloc>
2636 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2637 typename _Compare,
typename _Alloc>
2638 typename _Rb_tree<_Key, _Val, _KeyOfValue,
2642 const _Key& __k)
const
2646 __y = __x, __x =
_S_left(__x);
2652 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2653 typename _Compare,
typename _Alloc>
2654 template <
typename _Kt>
2661 __y = __x, __x =
_S_left(__x);
2667 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2668 typename _Compare,
typename _Alloc>
2669 typename _Rb_tree<_Key, _Val, _KeyOfValue,
2673 const _Key& __k)
const
2677 __y = __x, __x =
_S_left(__x);
2683 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2684 typename _Compare,
typename _Alloc>
2685 template <
typename _Kt>
2692 __y = __x, __x =
_S_left(__x);
2698 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2699 typename _Compare,
typename _Alloc>
2702 typename _Rb_tree<_Key, _Val, _KeyOfValue,
2716 __y = __x, __x =
_S_left(__x);
2721 __y = __x, __x =
_S_left(__x);
2730 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2731 typename _Compare,
typename _Alloc>
2734 typename _Rb_tree<_Key, _Val, _KeyOfValue,
2748 __y = __x, __x =
_S_left(__x);
2753 __y = __x, __x =
_S_left(__x);
2762 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2763 typename _Compare,
typename _Alloc>
2767 _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
2772 _M_impl._M_move_data(__t._M_impl);
2774 else if (!__t._M_root())
2775 __t._M_impl._M_move_data(
_M_impl);
2783 __t._M_root()->_M_parent = __t._M_end();
2784 std::swap(this->_M_impl._M_node_count, __t._M_impl._M_node_count);
2789 swap(this->_M_impl._M_key_compare, __t._M_impl._M_key_compare);
2792 __t._M_get_Node_allocator());
2795 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2796 typename _Compare,
typename _Alloc>
2799 typename _Rb_tree<_Key, _Val, _KeyOfValue,
2818 return _Res(__x, __y);
2823 return _Res(__x, __y);
2827 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2828 typename _Compare,
typename _Alloc>
2831 typename _Rb_tree<_Key, _Val, _KeyOfValue,
2844 return _Res(__x, __y);
2847#ifdef __glibcxx_associative_heterogeneous_insertion
2852 template <
typename _Key,
typename _Val,
typename _KeyOfValue,
2853 typename _Compare,
typename _Alloc>
2854 template <
typename _Kt>
2861 return { _M_end(), _M_end() };
2863 _Base_ptr __x = _M_begin(), __y = __x;
2864 bool __k_le_y =
false;
2868 __k_le_y = ! _M_key_compare(_S_key(__x), __k);
2869 __x = __k_le_y ? _S_left(__x) : _S_right(__x);
2882 if (__y == _M_rightmost())
2886 if (_M_key_compare(__k, _S_key(__j._M_node)))
2889 return { __y, __y };
2893 return { __j._M_node, {} };
2897 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2898 typename _Compare,
typename _Alloc>
2899#if __cplusplus >= 201103L
2900 template<
typename _Arg>
2903 _Compare, _Alloc>::iterator,
bool>
2905#if __cplusplus >= 201103L
2917 _Alloc_node __an(*
this);
2926 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2927 typename _Compare,
typename _Alloc>
2928#if __cplusplus >= 201103L
2929 template<
typename _Arg>
2933#if __cplusplus >= 201103L
2946 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
2947 typename _Compare,
typename _Alloc>
2950 typename _Rb_tree<_Key, _Val, _KeyOfValue,
3003#ifdef __glibcxx_associative_heterogeneous_insertion
3004 template <
typename _Key,
typename _Val,
typename _KeyOfValue,
3005 typename _Compare,
typename _Alloc>
3006 template <
typename _Kt>
3012 auto __node =__hint._M_node;
3013 if (__node == _M_end())
3015 if (
size() > 0 && _M_key_compare(_S_key(_M_rightmost()), __k))
3016 return { {}, _M_rightmost() };
3017 return _M_get_insert_unique_pos_tr(__k);
3019 if (_M_key_compare(__k, _S_key(__node)))
3021 if (__node == _M_leftmost())
3022 return { _M_leftmost(), _M_leftmost() };
3025 if (_M_key_compare(_S_key(__before._M_node), __k))
3028 return { {}, __before._M_node };
3029 return { __node, __node };
3031 return _M_get_insert_unique_pos_tr(__k);
3033 if (_M_key_compare(_S_key(__node), __k))
3035 if (__node == _M_rightmost())
3036 return { {}, _M_rightmost() };
3039 if (_M_key_compare(__k, _S_key(__after._M_node)))
3042 return { {}, __node };
3043 return { __after._M_node, __after._M_node };
3045 return _M_get_insert_unique_pos_tr(__k);
3049 if (__node == _M_leftmost() ||
3050 _M_key_compare(_S_key((--__before)._M_node), __k))
3051 {
return { __node, {} }; }
3052 return _M_get_insert_unique_pos_tr(__k);
3056 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3057 typename _Compare,
typename _Alloc>
3058#if __cplusplus >= 201103L
3059 template<
typename _Arg,
typename _NodeGen>
3061 template<
typename _NodeGen>
3066#
if __cplusplus >= 201103L
3071 _NodeGen& __node_gen)
3083 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3084 typename _Compare,
typename _Alloc>
3087 typename _Rb_tree<_Key, _Val, _KeyOfValue,
3137 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3138 typename _Compare,
typename _Alloc>
3139#if __cplusplus >= 201103L
3140 template<
typename _Arg,
typename _NodeGen>
3142 template<
typename _NodeGen>
3147#
if __cplusplus >= 201103L
3152 _NodeGen& __node_gen)
3165#if __cplusplus >= 201103L
3166 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3167 typename _Compare,
typename _Alloc>
3173 bool __insert_left = (__x || __p ==
_M_end()
3176 _Base_ptr __base_z = __z->_M_base_ptr();
3178 (__insert_left, __base_z, __p, this->_M_impl._M_header);
3183 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3184 typename _Compare,
typename _Alloc>
3190 bool __insert_left = (__p ==
_M_end()
3193 _Base_ptr __base_z = __z->_M_base_ptr();
3195 (__insert_left, __base_z, __p, this->_M_impl._M_header);
3200 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3201 typename _Compare,
typename _Alloc>
3218 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3219 typename _Compare,
typename _Alloc>
3220 template<
typename... _Args>
3230 return {
iterator(__res.first),
false};
3233 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3234 typename _Compare,
typename _Alloc>
3235 template<
typename... _Args>
3246 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3247 typename _Compare,
typename _Alloc>
3248 template<
typename... _Args>
3261 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3262 typename _Compare,
typename _Alloc>
3263 template<
typename... _Args>
3276#ifdef __glibcxx_associative_heterogeneous_insertion
3277 template <
typename _Key,
typename _Val,
typename _KeyOfValue,
3278 typename _Compare,
typename _Alloc>
3279 template <
typename... _Args>
3282 _M_emplace_here(
bool __place_left, _Base_ptr __node, _Args&&... __args)
3286 _Base_ptr __base_z = __z._M_node->_M_base_ptr();
3287 _Node_traits::_S_insert_and_rebalance(
3288 __place_left, __base_z, __node, _M_impl._M_header);
3289 __z._M_node =
nullptr;
3290 ++_M_impl._M_node_count;
3298 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3299 typename _Compare,
typename _Alloc>
3305 (__position.
_M_node, this->_M_impl._M_header);
3310 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3311 typename _Compare,
typename _Alloc>
3319 while (__first !=
__last)
3323 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3324 typename _Compare,
typename _Alloc>
3327 erase(
const _Key& __x)
3332 return __old_size -
size();
3335 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3336 typename _Compare,
typename _Alloc>
3337 template <
typename _Kt>
3345 return __old_size -
size();
3348 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3349 typename _Compare,
typename _Alloc>
3362 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3363 typename _Compare,
typename _Alloc>
3364 typename _Rb_tree<_Key, _Val, _KeyOfValue,
3367 find(
const _Key& __k)
3370 return (__j ==
end()
3374 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3375 typename _Compare,
typename _Alloc>
3376 typename _Rb_tree<_Key, _Val, _KeyOfValue,
3379 find(
const _Key& __k)
const
3382 return (__j ==
end()
3386 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3387 typename _Compare,
typename _Alloc>
3390 count(
const _Key& __k)
const
3397 _GLIBCXX_PURE
unsigned int
3401 template<
typename _Key,
typename _Val,
typename _KeyOfValue,
3402 typename _Compare,
typename _Alloc>
3408 && this->_M_impl._M_header._M_left ==
_M_end()
3409 && this->_M_impl._M_header._M_right ==
_M_end();
3418 if (__x->_M_color ==
_S_red)
3419 if ((__L && __L->_M_color ==
_S_red)
3420 || (__R && __R->_M_color ==
_S_red))
3439#ifdef __glibcxx_node_extract
3441 template<
typename _Key,
typename _Val,
typename _Sel,
typename _Cmp1,
3442 typename _Alloc,
typename _Cmp2>
3443 struct _Rb_tree_merge_helper<
_Rb_tree<_Key, _Val, _Sel, _Cmp1, _Alloc>,
3447 friend class _Rb_tree<_Key, _Val, _Sel, _Cmp1, _Alloc>;
3455#ifdef __glibcxx_associative_heterogeneous_erasure
3456template <
typename _Kt,
typename _Container>
3457 concept __heterogeneous_tree_key =
3459 __heterogeneous_key<_Kt, _Container>;
#define _GLIBCXX_FWDREF(_Tp)
#define _GLIBCXX_FORWARD(_Tp, __val)
#define __throw_exception_again
#define _GLIBCXX_VISIBILITY(V)
#define __glibcxx_assert(cond)
#define _GLIBCXX_NODISCARD
#define _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define _GLIBCXX_ABI_TAG_CXX11
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
typename __conditional< _Cond >::template type< _If, _Else > __conditional_t
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
typename enable_if< _Cond, _Tp >::type __enable_if_t
pair(_T1, _T2) -> pair< _T1, _T2 >
Two pairs are equal iff their members are equal.
auto declval() noexcept -> decltype(__declval< _Tp >(0))
constexpr _Tp * addressof(_Tp &__r) noexcept
Returns the actual address of the object or function referenced by r, even in the presence of an over...
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 bool operator<(const reverse_iterator< _IteratorL > &__x, const reverse_iterator< _IteratorR > &__y)
constexpr bool lexicographical_compare(_IIter1, _IIter1, _IIter2, _IIter2)
void _Rb_tree_insert_and_rebalance(const bool __insert_left, _Rb_tree_node_base *__x, _Rb_tree_node_base *__p, _Rb_tree_node_base &__header)
typename __has_is_transparent< _Func, _SfinaeType >::type __has_is_transparent_t
__PTRDIFF_TYPE__ ptrdiff_t
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
unsigned int _Rb_tree_black_count(const _Rb_tree_node_base *__node, const _Rb_tree_node_base *__root)
typename pointer_traits< _Ptr >::template rebind< _Tp > __ptr_rebind
Convenience alias for rebinding pointers.
bool operator!=(const fpos< _StateT > &__lhs, const fpos< _StateT > &__rhs)
_Rb_tree_node_base * _Rb_tree_decrement(_Rb_tree_node_base *__x)
constexpr bool equal(_IIter1, _IIter1, _IIter2)
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr __enable_if_t< __array_traits< _Tp, _Nm >::_Is_swappable::value > swap(array< _Tp, _Nm > &__one, array< _Tp, _Nm > &__two) noexcept(noexcept(__one.swap(__two)))
_Rb_tree_node_base * _Rb_tree_increment(_Rb_tree_node_base *__x)
_Rb_tree_node_base * _Rb_tree_rebalance_for_erase(_Rb_tree_node_base *const __z, _Rb_tree_node_base &__header)
ISO C++ entities toplevel namespace is std.
is_nothrow_default_constructible
is_nothrow_copy_constructible
is_nothrow_move_constructible
is_nothrow_move_assignable
The standard allocator, as per C++03 [20.4.1].
__ptr_traits_elem_t< _Ptr > element_type
static pointer pointer_to(element_type &__r)
__ptr_traits_elem_t< _ValPtr > element_type
Uniform interface to all pointer-like types.
_T1 first
The first member.
_T2 second
The second member.
Struct holding two objects of arbitrary type.
Bidirectional iterators support a superset of forward iterator operations.
static _Base_ptr _S_minimum(_Base_ptr __x) noexcept
_Rb_tree_node_base * _Base_ptr
static _Base_ptr _S_maximum(_Base_ptr __x) noexcept
_Base_ptr _M_base_ptr() const noexcept
_Rb_tree_key_compare() noexcept(/*conditional */)
_Key_compare _M_key_compare
_Rb_tree_key_compare(const _Key_compare &__comp)
_Rb_tree_key_compare(const _Rb_tree_key_compare &)=default
_Rb_tree_key_compare(_Rb_tree_key_compare &&__x) noexcept(is_nothrow_copy_constructible< _Key_compare >::value)
_Rb_tree_header(_Rb_tree_header &&__x) noexcept
void _M_move_data(_Rb_tree_header &__from)
_Rb_tree_header() noexcept
_Rb_tree_node_base _M_header
_Rb_tree_node * _M_node_ptr() noexcept
__gnu_cxx::__aligned_membuf< _Tp > _M_storage
const _Val * _M_valptr() const
static _Base_ptr _S_maximum(_Base_ptr __x) noexcept
_Base_ptr _M_base_ptr() const noexcept
static _Base_ptr _S_minimum(_Base_ptr __x) noexcept
__ptr_rebind< _VoidPtr, _Node_base > _Base_ptr
void _M_move_data(_Header &__from)
typename _NodeBase::_Base_ptr _Base_ptr
_Header(_Header &&__x) noexcept
_Node_ptr _M_node_ptr() noexcept
value_type const * _M_valptr() const
__ptr_rebind< _ValPtr, _Node > _Node_ptr
typename pointer_traits< _ValPtr >::element_type value_type
_Uninit_storage() noexcept
_Rb_tree_iterator & operator--() noexcept
_Rb_tree_iterator & operator++() noexcept
reference operator*() const noexcept
ptrdiff_t difference_type
friend bool operator==(const _Rb_tree_iterator &__x, const _Rb_tree_iterator &__y) noexcept
_Rb_tree_node_base::_Base_ptr _Base_ptr
pointer operator->() const noexcept
_Rb_tree_iterator() noexcept
bidirectional_iterator_tag iterator_category
_Rb_tree_iterator(_Base_ptr __x) noexcept
_Rb_tree_iterator operator--(int) noexcept
_Rb_tree_iterator operator++(int) noexcept
_Rb_tree_node< _Tp > * _Node_ptr
_Rb_tree_const_iterator operator++(int) noexcept
_Rb_tree_iterator< _Tp > iterator
_Rb_tree_node_base::_Base_ptr _Base_ptr
friend bool operator==(const _Rb_tree_const_iterator &__x, const _Rb_tree_const_iterator &__y) noexcept
_Rb_tree_const_iterator & operator++() noexcept
const _Rb_tree_node< _Tp > * _Node_ptr
_Rb_tree_const_iterator & operator--() noexcept
_Rb_tree_const_iterator() noexcept
ptrdiff_t difference_type
pointer operator->() const noexcept
reference operator*() const noexcept
bidirectional_iterator_tag iterator_category
_Rb_tree_const_iterator operator--(int) noexcept
_Rb_tree_const_iterator(const iterator &__it) noexcept
_Rb_tree_const_iterator(_Base_ptr __x) noexcept
reference operator*() const noexcept
_Iterator & operator=(const _Iterator &)=default
ptrdiff_t difference_type
__maybe_const< value_type > & reference
bidirectional_iterator_tag iterator_category
typename _Node_base::_Base_ptr _Base_ptr
constexpr _Iterator & operator--() noexcept
__rb_tree::_Node_base< __ptr_rebind< _ValPtr, void > > _Node_base
pointer_traits< _ValPtr > __ptr_traits
constexpr _Iterator operator--(int) noexcept
constexpr _Iterator & operator++() noexcept
typename __ptr_traits::element_type value_type
_Iterator(const _Iterator &)=default
constexpr _Iterator(const _Iterator< false, _ValPtr > &__it)
__conditional_t< _Const, const _Tp, _Tp > __maybe_const
constexpr _Iterator(_Base_ptr __x) noexcept
pointer operator->() const noexcept
__rb_tree::_Node< _ValPtr > _Node
friend bool operator==(const _Iterator &__x, const _Iterator &__y) noexcept
__maybe_const< value_type > * pointer
constexpr _Iterator operator++(int) noexcept
__rb_tree::_Iterator< false, _ValPtr > _Iterator
__rb_tree::_Node< _ValPtr > _Node
__rb_tree::_Header< _Node_base > _Header_t
static void _Rotate_left(_Base_ptr __x, _Base_ptr &__root)
__ptr_rebind< _ValPtr, _Node > _Node_ptr
static void _S_insert_and_rebalance(const bool __insert_left, _Base_ptr __x, _Base_ptr __p, _Node_base &__header)
static void _Rotate_right(_Base_ptr __x, _Base_ptr &__root)
__rb_tree::_Node_base< __ptr_rebind< _ValPtr, void > > _Node_base
static _Base_ptr _S_rebalance_for_erase(_Base_ptr __z, _Node_base &__header)
__ptr_rebind< _ValPtr, _Node_base > _Base_ptr
__rb_tree::_Iterator< true, _ValPtr > _Const_iterator
static _Node_base * _S_rebalance_for_erase(_Node_base *const __z, _Node_base &__header) noexcept
_Rb_tree_node_base _Node_base
static void _S_insert_and_rebalance(const bool __insert_left, _Node_base *__x, _Node_base *__p, _Node_base &__header) noexcept
_Rb_tree_const_iterator< _Val > _Const_iterator
_Rb_tree_iterator< _Val > _Iterator
_Rb_tree_header _Header_t
_Rb_tree_node< _Val > _Node
is_same< value_type, typename iterator_traits< _Iter >::value_type > __same_value_type
const value_type * const_pointer
pair< iterator, iterator > equal_range(const key_type &__k)
void _M_erase_aux(const_iterator __position)
void _M_assign_equal(_Iterator, _Iterator)
reverse_iterator rend() noexcept
friend auto operator<=>(const _Rb_tree &__x, const _Rb_tree &__y)
__gnu_cxx::__alloc_traits< _Pair_alloc_type >::template rebind< value_type >::other _Val_alloc_type
_Base_ptr _M_end() const noexcept
pair< _Base_ptr, _Base_ptr > _M_get_insert_hint_equal_pos(const_iterator __pos, const key_type &__k)
_Rb_tree(const _Compare &__comp, const allocator_type &__a=allocator_type())
static const _Key & _S_key(_Base_ptr __x)
_Base_ptr _M_upper_bound_tr(_Base_ptr __x, _Base_ptr __y, const _Kt &__k) const
const_reverse_iterator rbegin() const noexcept
size_type count(const key_type &__k) const
_Rb_tree(const _Rb_tree &__x)
_Rb_tree_impl< key_compare > _M_impl
__rb_tree::_Node_traits< value_type, _ValPtr > _Node_traits
_Node_traits::_Node_ptr _Node_ptr
_Pair_alloc_type allocator_type
size_type max_size() const noexcept
static const _Key & _S_key(const _Node &__node)
_Rb_tree(_Rb_tree &&__x, _Node_allocator &&__a, false_type)
_Rb_tree(const _Rb_tree &__x, const allocator_type &__a)
_Base_ptr _M_copy(const _Rb_tree &__x)
iterator _M_emplace_hint_equal(const_iterator __pos, _Args &&... __args)
_Node_ptr _M_begin_node() const noexcept
allocator_type get_allocator() const noexcept
_Node_ptr _M_clone_node(_Node_ptr __x, _NodeGen &__node_gen)
_Rb_tree(const allocator_type &__a)
size_type _M_erase_tr(const _Kt &__x)
iterator _M_emplace_hint_unique(const_iterator __pos, _Args &&... __args)
iterator _M_insert_node(_Base_ptr __x, _Base_ptr __y, _Node_ptr __z)
iterator _M_insert_equal_lower(_Arg &&__x)
_Node_traits::_Header_t _Header_t
__gnu_cxx::__alloc_traits< _Pair_alloc_type >::template rebind< _Node >::other _Node_allocator
void swap(_Rb_tree &__t) noexcept(/*conditional */)
_Node_ptr _M_create_node(_Args &&... __args)
void _M_drop_node(_Node_ptr __p) noexcept
_Base_ptr _M_copy(const _Rb_tree &__x, _NodeGen &__gen)
bool _M_key_compare(const _Key1 &__k1, const _Key2 &__k2) const
size_type erase(const key_type &__x)
iterator begin() noexcept
pair< _Base_ptr, _Base_ptr > _M_get_insert_equal_pos(const key_type &__k)
_Rb_tree(_Rb_tree &&__x, _Node_allocator &&__a) noexcept(noexcept(_Rb_tree(std::declval< _Rb_tree && >(), std::declval< _Node_allocator && >(), std::declval< typename _Node_alloc_traits::is_always_equal >())))
_Node_traits::_Base_ptr _Base_ptr
_Node_traits::_Iterator iterator
iterator _M_insert_unique_(const_iterator __pos, _Arg &&__x)
pair< _Base_ptr, _Base_ptr > _M_get_insert_hint_unique_pos(const_iterator __pos, const key_type &__k)
_Base_ptr & _M_leftmost() noexcept
iterator _M_emplace_equal(_Args &&... __args)
_Compare key_comp() const
iterator _M_insert_lower(_Base_ptr __y, _Arg &&__v)
iterator upper_bound(const key_type &__k)
_Base_ptr _M_lower_bound(_Base_ptr __x, _Base_ptr __y, const _Key &__k) const
__gnu_cxx::__alloc_traits< _Val_alloc_type > _Val_alloc_traits
iterator _M_insert_equal_lower_node(_Node_ptr __z)
_Val_alloc_traits::pointer _ValPtr
iterator _M_insert_equal_(const_iterator __pos, _Arg &&__x)
iterator _M_insert_equal_(const_iterator __pos, _Arg &&__x, _NodeGen &)
iterator lower_bound(const key_type &__k)
const value_type & const_reference
_Base_ptr _M_copy(_Node_ptr, _Base_ptr, _NodeGen &)
reverse_iterator rbegin() noexcept
_Base_ptr _M_rightmost() const noexcept
bool empty() const noexcept
_Node_traits::_Const_iterator const_iterator
static _Base_ptr _S_left(_Base_ptr __x) noexcept
_Node_allocator & _M_get_Node_allocator() noexcept
_Node_traits::_Node _Node
_Rb_tree(_Rb_tree &&__x, const allocator_type &__a)
void _M_move_assign(_Rb_tree &, true_type)
__enable_if_t< __same_value_type< _InputIterator >::value > _M_insert_range_unique(_InputIterator __first, _InputIterator __last)
_Base_ptr _M_lower_bound_tr(_Base_ptr __x, _Base_ptr __y, const _Kt &__k) const
void _M_move_data(_Rb_tree &__x, true_type)
const_iterator end() const noexcept
iterator _M_insert_unique_(const_iterator __pos, _Arg &&__x, _NodeGen &)
_Base_ptr _M_leftmost() const noexcept
iterator _M_insert_lower_node(_Base_ptr __p, _Node_ptr __z)
iterator find(const key_type &__k)
_Base_ptr & _M_rightmost() noexcept
_Base_ptr _M_begin() const noexcept
iterator _M_insert_(_Base_ptr __x, _Base_ptr __y, _Arg &&__v, _NodeGen &)
__gnu_cxx::__alloc_traits< _Node_allocator > _Node_alloc_traits
const_iterator begin() const noexcept
_Node_traits::_Node_base _Node_base
static const _Key & _S_key(_Node_ptr __x)
void _M_assign_unique(_Iterator, _Iterator)
void _M_destroy_node(_Node_ptr __p) noexcept
std::reverse_iterator< const_iterator > const_reverse_iterator
static _Base_ptr _S_right(_Base_ptr __x) noexcept
iterator _M_insert_equal(_Arg &&__x)
pair< iterator, bool > _M_insert_unique(_Arg &&__x)
size_type size() const noexcept
std::reverse_iterator< iterator > reverse_iterator
_Base_ptr & _M_root() noexcept
static _Node_ptr _S_right(_Node_ptr __x) noexcept
_Rb_tree(_Rb_tree &&)=default
_Base_ptr _M_root() const noexcept
size_type _M_erase_unique(const key_type &__x)
_Rb_tree(_Rb_tree &&__x, _Node_allocator &&__a, true_type) noexcept(is_nothrow_default_constructible< _Compare >::value)
__enable_if_t< __same_value_type< _InputIterator >::value > _M_insert_range_equal(_InputIterator __first, _InputIterator __last)
static _Node_ptr _S_left(_Node_ptr __x)
pair< _Base_ptr, _Base_ptr > _M_get_insert_unique_pos(const key_type &__k)
_Rb_tree & operator=(const _Rb_tree &__x)
pair< iterator, bool > _M_emplace_unique(_Args &&... __args)
const _Node_allocator & _M_get_Node_allocator() const noexcept
void _M_construct_node(_Node_ptr __node, _Args &&... __args)
friend bool operator==(const _Rb_tree &__x, const _Rb_tree &__y)
_Base_ptr _M_upper_bound(_Base_ptr __x, _Base_ptr __y, const _Key &__k) const
ptrdiff_t difference_type
const_reverse_iterator rend() const noexcept
void _M_put_node(_Node_ptr __p) noexcept
void _M_erase(_Node_ptr __x)
_Reuse_or_alloc_node(_Rb_tree &__t)
_Node_ptr operator()(_Arg &&__arg)
_Reuse_or_alloc_node(const _Reuse_or_alloc_node &)=delete
_Alloc_node(_Rb_tree &__t)
_Node_ptr operator()(_Arg &&__arg) const
_Rb_tree_key_compare< _Key_compare > _Base_key_compare
_Rb_tree_impl(_Rb_tree_impl &&__x, _Node_allocator &&__a)
_Rb_tree_impl() noexcept(/*conditional */)
_Rb_tree_impl(const _Rb_tree_impl &__x)
_Rb_tree_impl(_Rb_tree_impl &&) noexcept(is_nothrow_move_constructible< _Base_key_compare >::value)=default
_Rb_tree_impl(const _Key_compare &__comp, _Node_allocator &&__a)
iterator _M_insert(pair< _Base_ptr, _Base_ptr > __p)
const _Key & _M_key() const
_Auto_node(_Rb_tree &__t, _Args &&... __args)
iterator _M_insert_equal_lower()
_Base_type::pointer pointer
static constexpr void _S_on_swap(_Node_allocator &__a, _Node_allocator &__b)
static constexpr bool _S_always_equal()
static constexpr pointer allocate(_Node_allocator &__a, size_type __n)
static constexpr std::__enable_if_t< __is_custom_pointer< _Ptr >::value > destroy(_Node_allocator &__a, _Ptr __p) noexcept(noexcept(_Base_type::destroy(__a, std::__to_address(__p))))
static constexpr void deallocate(_Node_allocator &__a, pointer __p, size_type __n)
static constexpr size_type max_size(const _Node_allocator &__a) noexcept
static constexpr bool _S_nothrow_move()
static constexpr std::__enable_if_t< __is_custom_pointer< _Ptr >::value > construct(_Node_allocator &__a, _Ptr __p, _Args &&... __args) noexcept(noexcept(_Base_type::construct(__a, std::__to_address(__p), std::forward< _Args >(__args)...)))
static constexpr bool _S_propagate_on_copy_assign()
Uniform interface to C++98 and C++11 allocators.