STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
_Tree< _Traits > Class Template Reference
Inheritance diagram for _Tree< _Traits >:
_Tree_comp_alloc< _Traits >

Classes

struct  _Copy_tag
 
struct  _Move_tag
 

Public Types

enum  { _Multi = _Traits::_Multi }
 
typedef _Tree< _Traits > _Myt
 
typedef _Tree_comp_alloc< _Traits > _Mybase
 
typedef _Traits::key_type key_type
 
typedef _Traits::value_compare value_compare
 
typedef _Mybase::_Node _Node
 
typedef _Mybase::_Nodeptr _Nodeptr
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::key_compare key_compare
 
typedef _Mybase::allocator_type allocator_type
 
typedef _Mybase::value_type value_type
 
typedef _Mybase::size_type size_type
 
typedef _Mybase::difference_type difference_type
 
typedef _Mybase::pointer pointer
 
typedef _Mybase::const_pointer const_pointer
 
typedef _Mybase::reference reference
 
typedef _Mybase::const_reference const_reference
 
typedef _Mybase::const_iterator const_iterator
 
typedef _If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
 
typedef _STD reverse_iterator< iteratorreverse_iterator
 
typedef _STD reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef pair< iterator, bool_Pairib
 
typedef pair< iterator, iterator_Pairii
 
typedef pair< const_iterator, const_iterator_Paircc
 
- Public Types inherited from _Tree_comp_alloc< _Traits >
enum  _Redbl { _Red, _Black }
 
typedef _Tree_comp_alloc< _Traits > _Myt
 
typedef _Traits::allocator_type allocator_type
 
typedef _Traits::key_compare key_compare
 
typedef _Tree_base_types< typename _Traits::value_type, allocator_type_Alloc_types
 
typedef _Alloc_types::_Alloc _Alloc
 
typedef _Alloc_types::_Alnod_type _Alty
 
typedef _Alloc_types::_Node _Node
 
typedef _Alloc_types::_Nodeptr _Nodeptr
 
typedef _Alloc_types::_Val_types _Val_types
 
typedef _Nodeptr_Nodepref
 
typedef _Val_types::value_type value_type
 
typedef _Val_types::size_type size_type
 
typedef _Val_types::difference_type difference_type
 
typedef _Val_types::pointer pointer
 
typedef _Val_types::const_pointer const_pointer
 
typedef _Val_types::reference reference
 
typedef _Val_types::const_reference const_reference
 
typedef _Tree_const_iterator< _Tree_val< _Val_types > > const_iterator
 
typedef _Tree_iterator< _Tree_val< _Val_types > > iterator
 

Public Member Functions

 _Tree (const key_compare &_Parg)
 
 _Tree (const key_compare &_Parg, const allocator_type &_Al)
 
template<class _Any_alloc >
 _Tree (const _Myt &_Right, _Any_alloc &&_Al)
 
 _Tree (_Myt &&_Right)
 
 _Tree (_Myt &&_Right, const allocator_type &_Al)
 
_Mytoperator= (_Myt &&_Right)
 
void _Assign_rv (_Myt &&_Right, true_type)
 
void _Assign_rv (_Myt &&_Right, false_type)
 
template<class... _Valty>
_Pairib emplace (_Valty &&..._Val)
 
template<class... _Valty>
iterator emplace_hint (const_iterator _Where, _Valty &&..._Val)
 
 ~_Tree () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
reverse_iterator rbegin () _NOEXCEPT
 
const_reverse_iterator rbegin () const _NOEXCEPT
 
reverse_iterator rend () _NOEXCEPT
 
const_reverse_iterator rend () const _NOEXCEPT
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
const_reverse_iterator crbegin () const _NOEXCEPT
 
const_reverse_iterator crend () const _NOEXCEPT
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
bool empty () const _NOEXCEPT
 
allocator_type get_allocator () const _NOEXCEPT
 
key_compare key_comp () const
 
value_compare value_comp () const
 
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib insert (const value_type &_Val)
 
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator insert (const value_type &_Val)
 
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib insert (value_type &&_Val)
 
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator insert (value_type &&_Val)
 
iterator insert (const_iterator _Where, const value_type &_Val)
 
iterator insert (const_iterator _Where, value_type &&_Val)
 
template<class _Iter >
void insert (_Iter _First, _Iter _Last)
 
void insert (initializer_list< value_type > _Ilist)
 
iterator erase (const_iterator _Where)
 
iterator erase (const_iterator _First, const_iterator _Last)
 
size_type erase (const key_type &_Keyval)
 
void clear () _NOEXCEPT
 
iterator find (const key_type &_Keyval)
 
const_iterator find (const key_type &_Keyval) const
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
iterator find (const _Other &_Keyval)
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
const_iterator find (const _Other &_Keyval) const
 
size_type count (const key_type &_Keyval) const
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
size_type count (const _Other &_Keyval) const
 
iterator lower_bound (const key_type &_Keyval)
 
const_iterator lower_bound (const key_type &_Keyval) const
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
iterator lower_bound (const _Other &_Keyval)
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
const_iterator lower_bound (const _Other &_Keyval) const
 
iterator upper_bound (const key_type &_Keyval)
 
const_iterator upper_bound (const key_type &_Keyval) const
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
iterator upper_bound (const _Other &_Keyval)
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
const_iterator upper_bound (const _Other &_Keyval) const
 
_Pairii equal_range (const key_type &_Keyval)
 
_Paircc equal_range (const key_type &_Keyval) const
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
_Pairii equal_range (const _Other &_Keyval)
 
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
_Paircc equal_range (const _Other &_Keyval) const
 
void swap (_Myt &_Right)
 
- Public Member Functions inherited from _Tree_comp_alloc< _Traits >
 _Tree_comp_alloc (const key_compare &_Parg)
 
template<class _Any_alloc , class = enable_if_t<!is_same<decay_t<_Any_alloc>, _Myt>::value>>
 _Tree_comp_alloc (const key_compare &_Parg, _Any_alloc &&_Al)
 
void _Construct ()
 
 ~_Tree_comp_alloc () _NOEXCEPT
 
void _Alloc_proxy ()
 
void _Free_proxy ()
 
void _Copy_alloc (const _Alty &_Al)
 
void _Move_alloc (_Alty &_Al)
 
void _Orphan_all ()
 
void _Swap_all (_Myt &_Right)
 
_Nodeptr _Buyheadnode ()
 
void _Freeheadnode (_Nodeptr _Pnode)
 
_Nodeptr _Buynode0 ()
 
void _Freenode0 (_Nodeptr _Pnode)
 
template<class... _Valty>
_Nodeptr _Buynode (_Valty &&..._Val)
 
key_compare_Getcomp () _NOEXCEPT
 
const key_compare_Getcomp () const _NOEXCEPT
 
_Alty_Getal () _NOEXCEPT
 
const _Alty_Getal () const _NOEXCEPT
 
_Tree_val< _Val_types > & _Get_data () _NOEXCEPT
 
const _Tree_val< _Val_types > & _Get_data () const _NOEXCEPT
 
_Nodeptr_Myhead () _NOEXCEPT
 
const _Nodeptr_Myhead () const _NOEXCEPT
 
size_type_Mysize () _NOEXCEPT
 
const size_type_Mysize () const _NOEXCEPT
 

Protected Member Functions

template<class _Valty >
_Nodeptr _Buynode_if_nil (_Nodeptr _Node, _Valty &&)
 
template<class _Valty >
_Nodeptr _Buynode_if_nil (_Nil, _Valty &&_Val)
 
void _Destroy_if_not_nil (_Nodeptr _Newnode)
 
void _Destroy_if_not_nil (_Nil)
 
template<class _Valty , class _Nodety >
iterator _Insert_hint (const_iterator _Where, _Valty &&_Val, _Nodety _Newnode)
 
template<class _Valty , class _Nodety >
_Pairib _Insert_nohint (bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
 
template<class _Valty , class _Nodety >
iterator _Insert_at (bool _Addleft, _Nodeptr _Wherenode, _Valty &&_Val, _Nodety _Node)
 
template<class _Moveit >
void _Copy (const _Myt &_Right, _Moveit _Movefl)
 
template<class _Ty , class _Is_set >
_Nodeptr _Copy_or_move (_Ty &_Val, _Copy_tag, _Is_set)
 
template<class _Ty >
_Nodeptr _Copy_or_move (_Ty &_Val, _Move_tag, true_type)
 
template<class _Ty >
_Nodeptr _Copy_or_move (_Ty &_Val, _Move_tag, false_type)
 
template<class _Moveit >
_Nodeptr _Copy_nodes (_Nodeptr _Rootnode, _Nodeptr _Wherenode, _Moveit _Movefl)
 
template<class _Other >
_Paircc _Eqrange (const _Other &_Keyval) const
 
template<class _Other >
_Pairii _Eqrange (const _Other &_Keyval)
 
void _Erase (_Nodeptr _Rootnode)
 
bool _Compare (const key_type &_Left, const key_type &_Right) const
 
template<class _Ty1 , class _Ty2 >
bool _Compare (const _Ty1 &_Left, const _Ty2 &_Right) const
 
template<class _Other >
_Nodeptr _Lbound (const _Other &_Keyval) const
 
_Nodeptr_Lmost () const
 
void _Lrotate (_Nodeptr _Wherenode)
 
_Nodeptr_Rmost () const
 
_Nodeptr_Root () const
 
void _Rrotate (_Nodeptr _Wherenode)
 
template<class _Other >
_Nodeptr _Ubound (const _Other &_Keyval) const
 
void _Tidy ()
 
const key_type_Kfn (const value_type &_Val) const
 
const key_type_Key (_Nodeptr _Pnode) const
 

Additional Inherited Members

- Static Public Member Functions inherited from _Tree_comp_alloc< _Traits >
static char_Color (_Nodeptr _Pnode)
 
static char_Isnil (_Nodeptr _Pnode)
 
static _Nodepref _Left (_Nodeptr _Pnode)
 
static _Nodepref _Parent (_Nodeptr _Pnode)
 
static _Nodepref _Right (_Nodeptr _Pnode)
 
static reference _Myval (_Nodeptr _Pnode)
 
static _Nodeptr _Max (_Nodeptr _Pnode)
 
static _Nodeptr _Min (_Nodeptr _Pnode)
 

Member Typedef Documentation

template<class _Traits>
typedef _Mybase::_Alty _Tree< _Traits >::_Alty
template<class _Traits>
typedef _Tree_comp_alloc<_Traits> _Tree< _Traits >::_Mybase
template<class _Traits>
typedef _Tree<_Traits> _Tree< _Traits >::_Myt
template<class _Traits>
typedef _Mybase::_Node _Tree< _Traits >::_Node
template<class _Traits>
typedef _Mybase::_Nodeptr _Tree< _Traits >::_Nodeptr
template<class _Traits>
typedef pair<const_iterator, const_iterator> _Tree< _Traits >::_Paircc
template<class _Traits>
typedef pair<iterator, bool> _Tree< _Traits >::_Pairib
template<class _Traits>
typedef pair<iterator, iterator> _Tree< _Traits >::_Pairii
template<class _Traits>
typedef _Mybase::allocator_type _Tree< _Traits >::allocator_type
template<class _Traits>
typedef _Mybase::const_iterator _Tree< _Traits >::const_iterator
template<class _Traits>
typedef _Mybase::const_pointer _Tree< _Traits >::const_pointer
template<class _Traits>
typedef _Mybase::const_reference _Tree< _Traits >::const_reference
template<class _Traits>
typedef _STD reverse_iterator<const_iterator> _Tree< _Traits >::const_reverse_iterator
template<class _Traits>
typedef _Mybase::difference_type _Tree< _Traits >::difference_type
template<class _Traits>
typedef _If<is_same<key_type, value_type>::value, typename _Mybase::const_iterator, typename _Mybase::iterator>::type _Tree< _Traits >::iterator
template<class _Traits>
typedef _Mybase::key_compare _Tree< _Traits >::key_compare
template<class _Traits>
typedef _Traits::key_type _Tree< _Traits >::key_type
template<class _Traits>
typedef _Mybase::pointer _Tree< _Traits >::pointer
template<class _Traits>
typedef _Mybase::reference _Tree< _Traits >::reference
template<class _Traits>
typedef _STD reverse_iterator<iterator> _Tree< _Traits >::reverse_iterator
template<class _Traits>
typedef _Mybase::size_type _Tree< _Traits >::size_type
template<class _Traits>
typedef _Traits::value_compare _Tree< _Traits >::value_compare
template<class _Traits>
typedef _Mybase::value_type _Tree< _Traits >::value_type

Member Enumeration Documentation

template<class _Traits>
anonymous enum
Enumerator
_Multi 
980  { // get multi parameter
981  _Multi = _Traits::_Multi};
Definition: xtree:981

Constructor & Destructor Documentation

template<class _Traits>
_Tree< _Traits >::_Tree ( const key_compare _Parg)
inline
1018  : _Mybase(_Parg)
1019  { // construct empty tree from comparator
1020  }
_Tree_comp_alloc< _Traits > _Mybase
Definition: xtree:975
template<class _Traits>
_Tree< _Traits >::_Tree ( const key_compare _Parg,
const allocator_type _Al 
)
inline
1024  : _Mybase(_Parg, _Al)
1025  { // construct empty tree from comparator, allocator
1026  }
_Tree_comp_alloc< _Traits > _Mybase
Definition: xtree:975
template<class _Traits>
template<class _Any_alloc >
_Tree< _Traits >::_Tree ( const _Myt _Right,
_Any_alloc &&  _Al 
)
inline
1030  : _Mybase(_Right.key_comp(), _STD forward<_Any_alloc>(_Al))
1031  { // construct tree by copying _Right, allocator
1032  _TRY_BEGIN
1033  _Copy(_Right, _Copy_tag());
1034  _CATCH_ALL
1035  _Tidy();
1036  _RERAISE;
1037  _CATCH_END
1038  }
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
_Tree_comp_alloc< _Traits > _Mybase
Definition: xtree:975
#define _CATCH_ALL
Definition: xstddef:28
void _Copy(const _Myt &_Right, _Moveit _Movefl)
Definition: xtree:1935
void _Tidy()
Definition: xtree:2182
#define _RERAISE
Definition: xstddef:32
template<class _Traits>
_Tree< _Traits >::_Tree ( _Myt &&  _Right)
inline
1041  : _Mybase(_Right.key_comp(), _STD move(_Right._Getal()))
1042  { // construct tree by moving _Right
1044  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: xtree:1065
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
_Tree_comp_alloc< _Traits > _Mybase
Definition: xtree:975
integral_constant< bool, true > true_type
Definition: xtr1common:41
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Traits>
_Tree< _Traits >::_Tree ( _Myt &&  _Right,
const allocator_type _Al 
)
inline
1047  : _Mybase(_Right.key_comp(), _Al)
1048  { // construct tree by moving _Right, allocator
1050  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: xtree:1065
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
integral_constant< bool, false > false_type
Definition: xtr1common:42
_Tree_comp_alloc< _Traits > _Mybase
Definition: xtree:975
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Traits>
_Tree< _Traits >::~_Tree ( )
inline
1098  { // destroy tree
1099  _Tidy();
1100  }
void _Tidy()
Definition: xtree:2182

Member Function Documentation

template<class _Traits>
void _Tree< _Traits >::_Assign_rv ( _Myt &&  _Right,
true_type   
)
inline
1066  { // move from _Right, stealing its contents
1067  this->_Swap_all(_Right);
1068  _Swap_adl(this->_Getcomp(), _Right._Getcomp());
1069  _Swap_adl(this->_Myhead(), _Right._Myhead());
1070  _STD swap(this->_Mysize(), _Right._Mysize());
1071  }
void _Swap_all(_Myt &_Right)
Definition: xtree:826
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
void swap(_Myt &_Right)
Definition: xtree:1622
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:73
template<class _Traits>
void _Tree< _Traits >::_Assign_rv ( _Myt &&  _Right,
false_type   
)
inline
1074  { // move from _Right, possibly moving its contents
1075  if (this->_Getal() == _Right._Getal())
1077  else
1078  _Copy(_Right, _Move_tag());
1079  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: xtree:1065
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
void _Copy(const _Myt &_Right, _Moveit _Movefl)
Definition: xtree:1935
integral_constant< bool, true > true_type
Definition: xtr1common:41
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Traits>
template<class _Valty >
_Nodeptr _Tree< _Traits >::_Buynode_if_nil ( _Nodeptr  _Node,
_Valty &&   
)
inlineprotected
1637  { // node exists, just return it
1638  return (_Node);
1639  }
_Mybase::_Node _Node
Definition: xtree:983
template<class _Traits>
template<class _Valty >
_Nodeptr _Tree< _Traits >::_Buynode_if_nil ( _Nil  ,
_Valty &&  _Val 
)
inlineprotected
1643  { // node doesn't exist, make it
1644  return (this->_Buynode(_STD forward<_Valty>(_Val)));
1645  }
_Nodeptr _Buynode(_Valty &&..._Val)
Definition: xtree:894
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
bool _Tree< _Traits >::_Compare ( const key_type _Left,
const key_type _Right 
) const
inlineprotected
2062  { // compare key_type to key_type, with debug checks
2063  return (_DEBUG_LT_PRED(this->_Getcomp(), _Left, _Right));
2064  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
template<class _Traits>
template<class _Ty1 , class _Ty2 >
bool _Tree< _Traits >::_Compare ( const _Ty1 &  _Left,
const _Ty2 &  _Right 
) const
inlineprotected
2069  { // compare _Ty1 to _Ty2, without debug checks
2070  return (this->_Getcomp()(_Left, _Right));
2071  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
template<class _Traits>
template<class _Moveit >
void _Tree< _Traits >::_Copy ( const _Myt _Right,
_Moveit  _Movefl 
)
inlineprotected
1936  { // copy or move entire tree from _Right
1937  _Root() = _Copy_nodes(_Right._Root(), this->_Myhead(), _Movefl);
1938  this->_Mysize() = _Right.size();
1939  if (!this->_Isnil(_Root()))
1940  { // nonempty tree, look for new smallest and largest
1941  _Lmost() = this->_Min(_Root());
1942  _Rmost() = this->_Max(_Root());
1943  }
1944  else
1945  { // empty tree, just tidy head pointers
1946  _Lmost() = this->_Myhead();
1947  _Rmost() = this->_Myhead();
1948  }
1949  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Nodeptr & _Lmost() const
Definition: xtree:2091
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
_Nodeptr & _Rmost() const
Definition: xtree:2116
static _Nodeptr _Max(_Nodeptr _Pnode)
Definition: xtree:684
static _Nodeptr _Min(_Nodeptr _Pnode)
Definition: xtree:689
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
_Nodeptr & _Root() const
Definition: xtree:2121
_Nodeptr _Copy_nodes(_Nodeptr _Rootnode, _Nodeptr _Wherenode, _Moveit _Movefl)
Definition: xtree:1973
template<class _Traits>
template<class _Moveit >
_Nodeptr _Tree< _Traits >::_Copy_nodes ( _Nodeptr  _Rootnode,
_Nodeptr  _Wherenode,
_Moveit  _Movefl 
)
inlineprotected
1975  { // copy entire subtree, recursively
1976  _Nodeptr _Newroot = this->_Myhead(); // point at nil node
1977 
1978  if (!this->_Isnil(_Rootnode))
1979  { // copy or move a node, then any subtrees
1980  typename is_same<key_type, value_type>::type _Is_set;
1981  _Nodeptr _Pnode = _Copy_or_move(
1982  this->_Myval(_Rootnode), _Movefl, _Is_set);
1983  _Pnode->_Parent = _Wherenode;
1984  _Pnode->_Color = this->_Color(_Rootnode);
1985  if (this->_Isnil(_Newroot))
1986  _Newroot = _Pnode; // memorize new root
1987 
1988  _TRY_BEGIN
1989  this->_Left(_Pnode) =
1990  _Copy_nodes(this->_Left(_Rootnode), _Pnode, _Movefl);
1991  this->_Right(_Pnode) =
1992  _Copy_nodes(this->_Right(_Rootnode), _Pnode, _Movefl);
1993  _CATCH_ALL
1994  _Erase(_Newroot); // subtree copy failed, bail out
1995  _RERAISE;
1996  _CATCH_END
1997  }
1998 
1999  return (_Newroot); // return newly constructed tree
2000  }
Definition: xtr1common:23
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
void _Erase(_Nodeptr _Rootnode)
Definition: xtree:2047
static char & _Color(_Nodeptr _Pnode)
Definition: xtree:654
#define _CATCH_ALL
Definition: xstddef:28
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
#define _RERAISE
Definition: xstddef:32
_Nodeptr _Copy_or_move(_Ty &_Val, _Copy_tag, _Is_set)
Definition: xtree:1953
_Nodeptr _Copy_nodes(_Nodeptr _Rootnode, _Nodeptr _Wherenode, _Moveit _Movefl)
Definition: xtree:1973
template<class _Traits>
template<class _Ty , class _Is_set >
_Nodeptr _Tree< _Traits >::_Copy_or_move ( _Ty &  _Val,
_Copy_tag  ,
_Is_set   
)
inlineprotected
1954  { // copy to new node
1955  return (this->_Buynode(_Val));
1956  }
_Nodeptr _Buynode(_Valty &&..._Val)
Definition: xtree:894
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<class _Ty >
_Nodeptr _Tree< _Traits >::_Copy_or_move ( _Ty &  _Val,
_Move_tag  ,
true_type   
)
inlineprotected
1960  { // move to new node -- set
1961  return (this->_Buynode(_STD move(_Val)));
1962  }
_Nodeptr _Buynode(_Valty &&..._Val)
Definition: xtree:894
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<class _Ty >
_Nodeptr _Tree< _Traits >::_Copy_or_move ( _Ty &  _Val,
_Move_tag  ,
false_type   
)
inlineprotected
1966  { // move to new node -- map
1967  return (this->_Buynode(
1968  _STD move(const_cast<key_type&>(_Val.first)),
1969  _STD move(_Val.second)));
1970  }
_Nodeptr _Buynode(_Valty &&..._Val)
Definition: xtree:894
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
void _Tree< _Traits >::_Destroy_if_not_nil ( _Nodeptr  _Newnode)
inlineprotected
1648  { // node exists, destroy it
1649  this->_Getal().destroy(
1650  _STD addressof(this->_Myval(_Newnode)));
1651 
1652  this->_Getal().deallocate(_Newnode, 1);
1653  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
template<class _Traits>
void _Tree< _Traits >::_Destroy_if_not_nil ( _Nil  )
inlineprotected
1656  { // node doesn't exist, do nothing
1657  }
template<class _Traits>
template<class _Other >
_Paircc _Tree< _Traits >::_Eqrange ( const _Other &  _Keyval) const
inlineprotected
2004  { // find leftmost node not less than _Keyval
2005  _Nodeptr _Pnode = _Root();
2006  _Nodeptr _Lonode = this->_Myhead(); // end() if search fails
2007  _Nodeptr _Hinode = this->_Myhead(); // end() if search fails
2008 
2009  while (!this->_Isnil(_Pnode))
2010  if (_DEBUG_LT_PRED(this->_Getcomp(), this->_Key(_Pnode), _Keyval))
2011  _Pnode = this->_Right(_Pnode); // descend right subtree
2012  else
2013  { // _Pnode not less than _Keyval, remember it
2014  if (this->_Isnil(_Hinode)
2015  && _DEBUG_LT_PRED(this->_Getcomp(), _Keyval,
2016  this->_Key(_Pnode)))
2017  _Hinode = _Pnode; // _Pnode greater, remember it
2018  _Lonode = _Pnode;
2019  _Pnode = this->_Left(_Pnode); // descend left subtree
2020  }
2021 
2022  _Pnode = this->_Isnil(_Hinode) ? _Root()
2023  : this->_Left(_Hinode); // continue scan for upper bound
2024  while (!this->_Isnil(_Pnode))
2025  if (_DEBUG_LT_PRED(this->_Getcomp(), _Keyval, this->_Key(_Pnode)))
2026  { // _Pnode greater than _Keyval, remember it
2027  _Hinode = _Pnode;
2028  _Pnode = this->_Left(_Pnode); // descend left subtree
2029  }
2030  else
2031  _Pnode = this->_Right(_Pnode); // descend right subtree
2032 
2033  const_iterator _First = const_iterator(_Lonode, _STD addressof(this->_Get_data()));
2035  return (_Paircc(_First, _Last));
2036  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
_Mybase::const_iterator const_iterator
Definition: xtree:998
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
return * this
Definition: variant:950
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
pair< const_iterator, const_iterator > _Paircc
Definition: xtree:1008
_Nodeptr & _Root() const
Definition: xtree:2121
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_FwdIt _Last
Definition: algorithm:1936
template<class _Traits>
template<class _Other >
_Pairii _Tree< _Traits >::_Eqrange ( const _Other &  _Keyval)
inlineprotected
2040  { // find leftmost node not less than _Keyval
2041  _Paircc _Ans(static_cast<const _Myt *>(this)->_Eqrange(_Keyval));
2042  iterator _First = iterator(_Ans.first._Ptr, _STD addressof(this->_Get_data()));
2043  iterator _Last = iterator(_Ans.second._Ptr, _STD addressof(this->_Get_data()));
2044  return (_Pairii(_First, _Last));
2045  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
Definition: xutility:565
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
pair< const_iterator, const_iterator > _Paircc
Definition: xtree:1008
pair< iterator, iterator > _Pairii
Definition: xtree:1007
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_Paircc _Eqrange(const _Other &_Keyval) const
Definition: xtree:2003
_FwdIt _Last
Definition: algorithm:1936
template<class _Traits>
void _Tree< _Traits >::_Erase ( _Nodeptr  _Rootnode)
inlineprotected
2048  { // free entire subtree, recursively
2049  for (_Nodeptr _Pnode = _Rootnode;
2050  !this->_Isnil(_Pnode); _Rootnode = _Pnode)
2051  { // free subtrees, then node
2052  _Erase(this->_Right(_Pnode));
2053  _Pnode = this->_Left(_Pnode);
2054  this->_Getal().destroy(
2055  _STD addressof(this->_Myval(_Rootnode)));
2056 
2057  this->_Getal().deallocate(_Rootnode, 1);
2058  }
2059  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
void _Erase(_Nodeptr _Rootnode)
Definition: xtree:2047
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
template<class _Traits>
template<class _Valty , class _Nodety >
iterator _Tree< _Traits >::_Insert_at ( bool  _Addleft,
_Nodeptr  _Wherenode,
_Valty &&  _Val,
_Nodety  _Node 
)
inlineprotected
1843  { // add node with value next to _Wherenode, to left if _Addleft
1844  if (max_size() - 1 <= this->_Mysize())
1845  { // tree would get too big, fail
1847  _Xlength_error("map/set<T> too long");
1848  }
1849  _Nodeptr _Newnode = _Buynode_if_nil(_Node,
1850  _STD forward<_Valty>(_Val));
1851 
1852  ++this->_Mysize();
1853  _Newnode->_Parent = _Wherenode;
1854 
1855  if (_Wherenode == this->_Myhead())
1856  { // first node in tree, just set head values
1857  _Root() = _Newnode;
1858  _Lmost() = _Newnode;
1859  _Rmost() = _Newnode;
1860  }
1861  else if (_Addleft)
1862  { // add to left of _Wherenode
1863  this->_Left(_Wherenode) = _Newnode;
1864  if (_Wherenode == _Lmost())
1865  _Lmost() = _Newnode;
1866  }
1867  else
1868  { // add to right of _Wherenode
1869  this->_Right(_Wherenode) = _Newnode;
1870  if (_Wherenode == _Rmost())
1871  _Rmost() = _Newnode;
1872  }
1873 
1874  for (_Nodeptr _Pnode = _Newnode;
1875  this->_Color(this->_Parent(_Pnode)) == this->_Red; )
1876  if (this->_Parent(_Pnode)
1877  == this->_Left(this->_Parent(this->_Parent(_Pnode))))
1878  { // fixup red-red in left subtree
1879  _Wherenode =
1880  this->_Right(this->_Parent(this->_Parent(_Pnode)));
1881  if (this->_Color(_Wherenode) == this->_Red)
1882  { // parent has two red children, blacken both
1883  this->_Color(this->_Parent(_Pnode)) = this->_Black;
1884  this->_Color(_Wherenode) = this->_Black;
1885  this->_Color(this->_Parent(this->_Parent(_Pnode)))
1886  = this->_Red;
1887  _Pnode = this->_Parent(this->_Parent(_Pnode));
1888  }
1889  else
1890  { // parent has red and black children
1891  if (_Pnode == this->_Right(this->_Parent(_Pnode)))
1892  { // rotate right child to left
1893  _Pnode = this->_Parent(_Pnode);
1894  _Lrotate(_Pnode);
1895  }
1896  this->_Color(this->_Parent(_Pnode)) =
1897  this->_Black; // propagate red up
1898  this->_Color(this->_Parent(this->_Parent(_Pnode))) =
1899  this->_Red;
1900  _Rrotate(this->_Parent(this->_Parent(_Pnode)));
1901  }
1902  }
1903  else
1904  { // fixup red-red in right subtree
1905  _Wherenode =
1906  this->_Left(this->_Parent(this->_Parent(_Pnode)));
1907  if (this->_Color(_Wherenode) == this->_Red)
1908  { // parent has two red children, blacken both
1909  this->_Color(this->_Parent(_Pnode)) = this->_Black;
1910  this->_Color(_Wherenode) = this->_Black;
1911  this->_Color(this->_Parent(this->_Parent(_Pnode))) =
1912  this->_Red;
1913  _Pnode = this->_Parent(this->_Parent(_Pnode));
1914  }
1915  else
1916  { // parent has red and black children
1917  if (_Pnode == this->_Left(this->_Parent(_Pnode)))
1918  { // rotate left child to right
1919  _Pnode = this->_Parent(_Pnode);
1920  _Rrotate(_Pnode);
1921  }
1922  this->_Color(this->_Parent(_Pnode)) =
1923  this->_Black; // propagate red up
1924  this->_Color(this->_Parent(this->_Parent(_Pnode))) =
1925  this->_Red;
1926  _Lrotate(this->_Parent(this->_Parent(_Pnode)));
1927  }
1928  }
1929 
1930  this->_Color(_Root()) = this->_Black; // root is always black
1931  return (iterator(_Newnode, _STD addressof(this->_Get_data())));
1932  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
void _Lrotate(_Nodeptr _Wherenode)
Definition: xtree:2096
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
void _Destroy_if_not_nil(_Nodeptr _Newnode)
Definition: xtree:1647
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Nodeptr & _Lmost() const
Definition: xtree:2091
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
Definition: xtree:651
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Nodeptr & _Rmost() const
Definition: xtree:2116
_Mybase::_Node _Node
Definition: xtree:983
Definition: xtree:651
void _Rrotate(_Nodeptr _Wherenode)
Definition: xtree:2126
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
_Nodeptr _Buynode_if_nil(_Nodeptr _Node, _Valty &&)
Definition: xtree:1636
static char & _Color(_Nodeptr _Pnode)
Definition: xtree:654
_Nodeptr & _Root() const
Definition: xtree:2121
size_type max_size() const _NOEXCEPT
Definition: xtree:1179
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_FwdIt const _Ty _Val
Definition: algorithm:1938
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xlength_error(_In_z_ const char *)
template<class _Traits>
template<class _Valty , class _Nodety >
iterator _Tree< _Traits >::_Insert_hint ( const_iterator  _Where,
_Valty &&  _Val,
_Nodety  _Newnode 
)
inlineprotected
1663  { // try to insert node using _Where as a hint
1664  const_iterator _Next;
1665  bool _Leftish = false; // assume nearest point is end of sequence
1666 
1667  _TRY_BEGIN
1668 
1669  #if _ITERATOR_DEBUG_LEVEL == 2
1670  if (_Where._Getcont() != _STD addressof(this->_Get_data()))
1671  {
1672  _DEBUG_ERROR("map/set insert iterator outside range");
1673  }
1674  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1675 
1676 #pragma warning(push)
1677 #pragma warning(disable: 4127) // conditional expression is constant
1678  if (size() == 0)
1679  return (_Insert_at(true, this->_Myhead(),
1680  _STD forward<_Valty>(_Val), _Newnode)); // empty tree
1681  else if (this->_Multi)
1682  { // insert even if duplicate
1683  if (_Where == begin())
1684  { // insert at beginning if before first element
1685  if (!_DEBUG_LT_PRED(this->_Getcomp(),
1686  this->_Key(_Where._Mynode()), this->_Kfn(_Val)))
1687  return (_Insert_at(true, _Where._Mynode(),
1688  _STD forward<_Valty>(_Val), _Newnode));
1689  _Leftish = true; // nearest point is beginning of sequence
1690  }
1691  else if (_Where == end())
1692  { // insert at end if after last element
1693  if (!_DEBUG_LT_PRED(this->_Getcomp(),
1694  this->_Kfn(_Val), this->_Key(_Rmost())))
1695  return (_Insert_at(false, _Rmost(),
1696  _STD forward<_Valty>(_Val), _Newnode));
1697  }
1698  else if (!_DEBUG_LT_PRED(this->_Getcomp(),
1699  this->_Key(_Where._Mynode()), this->_Kfn(_Val))
1700  && !_DEBUG_LT_PRED(this->_Getcomp(),
1701  this->_Kfn(_Val),
1702  this->_Key((--(_Next = _Where))._Mynode())))
1703  { // insert before _Where
1704  if (this->_Isnil(this->_Right(_Next._Mynode())))
1705  return (_Insert_at(false, _Next._Mynode(),
1706  _STD forward<_Valty>(_Val), _Newnode));
1707  else
1708  return (_Insert_at(true, _Where._Mynode(),
1709  _STD forward<_Valty>(_Val), _Newnode));
1710  }
1711  else if (!_DEBUG_LT_PRED(this->_Getcomp(),
1712  this->_Kfn(_Val), this->_Key(_Where._Mynode()))
1713  && (++(_Next = _Where) == end()
1714  || !_DEBUG_LT_PRED(this->_Getcomp(),
1715  this->_Key(_Next._Mynode()), this->_Kfn(_Val))))
1716  { // insert after _Where
1717  if (this->_Isnil(this->_Right(_Where._Mynode())))
1718  return (_Insert_at(false, _Where._Mynode(),
1719  _STD forward<_Valty>(_Val), _Newnode));
1720  else
1721  return (_Insert_at(true, _Next._Mynode(),
1722  _STD forward<_Valty>(_Val), _Newnode));
1723  }
1724  else
1725  _Leftish = true; // nearest point is beginning of sequence
1726  }
1727  else
1728  { // insert only if unique
1729  if (_Where == begin())
1730  { // insert at beginning if before first element
1731  if (_DEBUG_LT_PRED(this->_Getcomp(),
1732  this->_Kfn(_Val), this->_Key(_Where._Mynode())))
1733  return (_Insert_at(true, _Where._Mynode(),
1734  _STD forward<_Valty>(_Val), _Newnode));
1735  }
1736  else if (_Where == end())
1737  { // insert at end if after last element
1738  if (_DEBUG_LT_PRED(this->_Getcomp(),
1739  this->_Key(_Rmost()), this->_Kfn(_Val)))
1740  return (_Insert_at(false, _Rmost(),
1741  _STD forward<_Valty>(_Val), _Newnode));
1742  }
1743  else if (_DEBUG_LT_PRED(this->_Getcomp(),
1744  this->_Kfn(_Val), this->_Key(_Where._Mynode()))
1745  && _DEBUG_LT_PRED(this->_Getcomp(),
1746  this->_Key((--(_Next = _Where))._Mynode()),
1747  this->_Kfn(_Val)))
1748  { // insert before _Where
1749  if (this->_Isnil(this->_Right(_Next._Mynode())))
1750  return (_Insert_at(false, _Next._Mynode(),
1751  _STD forward<_Valty>(_Val), _Newnode));
1752  else
1753  return (_Insert_at(true, _Where._Mynode(),
1754  _STD forward<_Valty>(_Val), _Newnode));
1755  }
1756  else if (_DEBUG_LT_PRED(this->_Getcomp(),
1757  this->_Key(_Where._Mynode()), this->_Kfn(_Val))
1758  && (++(_Next = _Where) == end()
1759  || _DEBUG_LT_PRED(this->_Getcomp(),
1760  this->_Kfn(_Val), this->_Key(_Next._Mynode()))))
1761  { // insert after _Where
1762  if (this->_Isnil(this->_Right(_Where._Mynode())))
1763  return (_Insert_at(false, _Where._Mynode(),
1764  _STD forward<_Valty>(_Val), _Newnode));
1765  else
1766  return (_Insert_at(true, _Next._Mynode(),
1767  _STD forward<_Valty>(_Val), _Newnode));
1768  }
1769  }
1770 #pragma warning(pop)
1771  _CATCH_ALL
1772  _Destroy_if_not_nil(_Newnode);
1773  _RERAISE;
1774  _CATCH_END
1775 
1776  return (_Insert_nohint(_Leftish,
1777  _STD forward<_Valty>(_Val), _Newnode).first);
1778  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
void _Destroy_if_not_nil(_Nodeptr _Newnode)
Definition: xtree:1647
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
_Nodeptr & _Rmost() const
Definition: xtree:2116
_Mybase::const_iterator const_iterator
Definition: xtree:998
iterator _Insert_at(bool _Addleft, _Nodeptr _Wherenode, _Valty &&_Val, _Nodety _Node)
Definition: xtree:1841
iterator end() _NOEXCEPT
Definition: xtree:1124
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
#define _CATCH_ALL
Definition: xstddef:28
iterator begin() _NOEXCEPT
Definition: xtree:1114
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
_Pairib _Insert_nohint(bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1782
Definition: xtree:981
size_type size() const _NOEXCEPT
Definition: xtree:1174
#define _RERAISE
Definition: xstddef:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
const key_type & _Kfn(const value_type &_Val) const
Definition: xtree:2187
template<class _Traits>
template<class _Valty , class _Nodety >
_Pairib _Tree< _Traits >::_Insert_nohint ( bool  _Leftish,
_Valty &&  _Val,
_Nodety  _Newnode 
)
inlineprotected
1784  { // try to insert node, on left if _Leftish
1785  _TRY_BEGIN
1786  _Nodeptr _Trynode = _Root();
1787  _Nodeptr _Wherenode = this->_Myhead();
1788  bool _Addleft = true; // add to left of head if tree empty
1789 
1790  while (!this->_Isnil(_Trynode))
1791  { // look for leaf to insert before (_Addleft) or after
1792  _Wherenode = _Trynode;
1793  if (_Leftish)
1794  _Addleft = !_DEBUG_LT_PRED(this->_Getcomp(),
1795  this->_Key(_Trynode),
1796  this->_Kfn(_Val)); // favor left end
1797  else
1798  _Addleft = _DEBUG_LT_PRED(this->_Getcomp(),
1799  this->_Kfn(_Val),
1800  this->_Key(_Trynode)); // favor right end
1801  _Trynode = _Addleft ? this->_Left(_Trynode)
1802  : this->_Right(_Trynode);
1803  }
1804 
1805 #pragma warning(push)
1806 #pragma warning(disable: 4127) // conditional expression is constant
1807  if (this->_Multi)
1808  return (_Pairib(_Insert_at(_Addleft, _Wherenode,
1809  _STD forward<_Valty>(_Val), _Newnode), true));
1810  else
1811  { // insert only if unique
1812  iterator _Where = iterator(_Wherenode, _STD addressof(this->_Get_data()));
1813  if (!_Addleft)
1814  ; // need to test if insert after is okay
1815  else if (_Where == begin())
1816  return (_Pairib(_Insert_at(true, _Wherenode,
1817  _STD forward<_Valty>(_Val), _Newnode), true));
1818  else
1819  --_Where; // need to test if insert before is okay
1820 
1821  if (_DEBUG_LT_PRED(this->_Getcomp(),
1822  this->_Key(_Where._Mynode()),
1823  this->_Kfn(_Val)))
1824  return (_Pairib(_Insert_at(_Addleft, _Wherenode,
1825  _STD forward<_Valty>(_Val), _Newnode), true));
1826  else
1827  { // duplicate, don't insert
1828  _Destroy_if_not_nil(_Newnode);
1829  return (_Pairib(_Where, false));
1830  }
1831  }
1832 #pragma warning(pop)
1833  _CATCH_ALL
1834  _Destroy_if_not_nil(_Newnode);
1835  _RERAISE;
1836  _CATCH_END
1837  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
void _Destroy_if_not_nil(_Nodeptr _Newnode)
Definition: xtree:1647
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
Definition: xutility:565
pair< iterator, bool > _Pairib
Definition: xtree:1006
iterator _Insert_at(bool _Addleft, _Nodeptr _Wherenode, _Valty &&_Val, _Nodety _Node)
Definition: xtree:1841
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
return * this
Definition: variant:950
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
_Nodeptr & _Root() const
Definition: xtree:2121
#define _CATCH_ALL
Definition: xstddef:28
iterator begin() _NOEXCEPT
Definition: xtree:1114
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
Definition: xtree:981
#define _RERAISE
Definition: xstddef:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
const key_type & _Kfn(const value_type &_Val) const
Definition: xtree:2187
template<class _Traits>
const key_type& _Tree< _Traits >::_Key ( _Nodeptr  _Pnode) const
inlineprotected
2193  { // return reference to key in node
2194  return ((const key_type&)this->_Kfn(this->_Myval(_Pnode)));
2195  }
_Traits::key_type key_type
Definition: xtree:977
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
const key_type & _Kfn(const value_type &_Val) const
Definition: xtree:2187
template<class _Traits>
const key_type& _Tree< _Traits >::_Kfn ( const value_type _Val) const
inlineprotected
2188  { // get key from value
2189  return (_Traits::_Kfn(_Val));
2190  }
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<class _Other >
_Nodeptr _Tree< _Traits >::_Lbound ( const _Other &  _Keyval) const
inlineprotected
2075  { // find leftmost node not less than _Keyval
2076  _Nodeptr _Pnode = _Root();
2077  _Nodeptr _Wherenode = this->_Myhead(); // end() if search fails
2078 
2079  while (!this->_Isnil(_Pnode))
2080  if (_Compare(this->_Key(_Pnode), _Keyval))
2081  _Pnode = this->_Right(_Pnode); // descend right subtree
2082  else
2083  { // _Pnode not less than _Keyval, remember it
2084  _Wherenode = _Pnode;
2085  _Pnode = this->_Left(_Pnode); // descend left subtree
2086  }
2087 
2088  return (_Wherenode); // return best remembered candidate
2089  }
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
bool _Compare(const key_type &_Left, const key_type &_Right) const
Definition: xtree:2061
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
_Nodeptr & _Root() const
Definition: xtree:2121
template<class _Traits>
_Nodeptr& _Tree< _Traits >::_Lmost ( ) const
inlineprotected
2092  { // return leftmost node in nonmutable tree
2093  return (this->_Left(this->_Myhead()));
2094  }
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
template<class _Traits>
void _Tree< _Traits >::_Lrotate ( _Nodeptr  _Wherenode)
inlineprotected
2097  { // promote right node to root of subtree
2098  _Nodeptr _Pnode = this->_Right(_Wherenode);
2099  this->_Right(_Wherenode) = this->_Left(_Pnode);
2100 
2101  if (!this->_Isnil(this->_Left(_Pnode)))
2102  this->_Parent(this->_Left(_Pnode)) = _Wherenode;
2103  this->_Parent(_Pnode) = this->_Parent(_Wherenode);
2104 
2105  if (_Wherenode == _Root())
2106  _Root() = _Pnode;
2107  else if (_Wherenode == this->_Left(this->_Parent(_Wherenode)))
2108  this->_Left(this->_Parent(_Wherenode)) = _Pnode;
2109  else
2110  this->_Right(this->_Parent(_Wherenode)) = _Pnode;
2111 
2112  this->_Left(_Pnode) = _Wherenode;
2113  this->_Parent(_Wherenode) = _Pnode;
2114  }
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
_Nodeptr & _Root() const
Definition: xtree:2121
template<class _Traits>
_Nodeptr& _Tree< _Traits >::_Rmost ( ) const
inlineprotected
2117  { // return rightmost node in nonmutable tree
2118  return (this->_Right(this->_Myhead()));
2119  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
template<class _Traits>
_Nodeptr& _Tree< _Traits >::_Root ( ) const
inlineprotected
2122  { // return root of nonmutable tree
2123  return (this->_Parent(this->_Myhead()));
2124  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
template<class _Traits>
void _Tree< _Traits >::_Rrotate ( _Nodeptr  _Wherenode)
inlineprotected
2127  { // promote left node to root of subtree
2128  _Nodeptr _Pnode = this->_Left(_Wherenode);
2129  this->_Left(_Wherenode) = this->_Right(_Pnode);
2130 
2131  if (!this->_Isnil(this->_Right(_Pnode)))
2132  this->_Parent(this->_Right(_Pnode)) = _Wherenode;
2133  this->_Parent(_Pnode) = this->_Parent(_Wherenode);
2134 
2135  if (_Wherenode == _Root())
2136  _Root() = _Pnode;
2137  else if (_Wherenode == this->_Right(this->_Parent(_Wherenode)))
2138  this->_Right(this->_Parent(_Wherenode)) = _Pnode;
2139  else
2140  this->_Left(this->_Parent(_Wherenode)) = _Pnode;
2141 
2142  this->_Right(_Pnode) = _Wherenode;
2143  this->_Parent(_Wherenode) = _Pnode;
2144  }
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
_Nodeptr & _Root() const
Definition: xtree:2121
template<class _Traits>
void _Tree< _Traits >::_Tidy ( )
inlineprotected
2183  { // free all storage
2184  erase(begin(), end());
2185  }
iterator end() _NOEXCEPT
Definition: xtree:1124
iterator erase(const_iterator _Where)
Definition: xtree:1263
iterator begin() _NOEXCEPT
Definition: xtree:1114
template<class _Traits>
template<class _Other >
_Nodeptr _Tree< _Traits >::_Ubound ( const _Other &  _Keyval) const
inlineprotected
2148  { // find leftmost node greater than _Keyval
2149  _Nodeptr _Pnode = _Root();
2150  _Nodeptr _Wherenode = this->_Myhead(); // end() if search fails
2151 
2152  while (!this->_Isnil(_Pnode))
2153  if (_Compare(_Keyval, this->_Key(_Pnode)))
2154  { // _Pnode greater than _Keyval, remember it
2155  _Wherenode = _Pnode;
2156  _Pnode = this->_Left(_Pnode); // descend left subtree
2157  }
2158  else
2159  _Pnode = this->_Right(_Pnode); // descend right subtree
2160 
2161  return (_Wherenode); // return best remembered candidate
2162  }
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
bool _Compare(const key_type &_Left, const key_type &_Right) const
Definition: xtree:2061
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
_Nodeptr & _Root() const
Definition: xtree:2121
template<class _Traits>
iterator _Tree< _Traits >::begin ( )
inline
1115  { // return iterator for beginning of mutable sequence
1116  return (iterator(_Lmost(), _STD addressof(this->_Get_data())));
1117  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr & _Lmost() const
Definition: xtree:2091
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
const_iterator _Tree< _Traits >::begin ( ) const
inline
1120  { // return iterator for beginning of nonmutable sequence
1121  return (const_iterator(_Lmost(), _STD addressof(this->_Get_data())));
1122  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr & _Lmost() const
Definition: xtree:2091
_Mybase::const_iterator const_iterator
Definition: xtree:998
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
const_iterator _Tree< _Traits >::cbegin ( ) const
inline
1155  { // return iterator for beginning of nonmutable sequence
1156  return (begin());
1157  }
iterator begin() _NOEXCEPT
Definition: xtree:1114
template<class _Traits>
const_iterator _Tree< _Traits >::cend ( ) const
inline
1160  { // return iterator for end of nonmutable sequence
1161  return (end());
1162  }
iterator end() _NOEXCEPT
Definition: xtree:1124
template<class _Traits>
void _Tree< _Traits >::clear ( )
inline
1475  { // erase all
1476  #if _ITERATOR_DEBUG_LEVEL == 2
1477  this->_Orphan_ptr(nullptr_t{});
1478  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1479 
1480  _Erase(_Root());
1481  _Root() = this->_Myhead();
1482  _Lmost() = this->_Myhead();
1483  _Rmost() = this->_Myhead();
1484  this->_Mysize() = 0;
1485  }
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Nodeptr & _Lmost() const
Definition: xtree:2091
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
_Nodeptr & _Rmost() const
Definition: xtree:2116
void _Erase(_Nodeptr _Rootnode)
Definition: xtree:2047
_Nodeptr & _Root() const
Definition: xtree:2121
template<class _Traits>
size_type _Tree< _Traits >::count ( const key_type _Keyval) const
inline
1530  { // count all elements that match _Keyval
1531  _Paircc _Ans = equal_range(_Keyval);
1532  return (_STD distance(_Ans.first, _Ans.second));
1533  }
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1111
_Pairii equal_range(const key_type &_Keyval)
Definition: xtree:1596
pair< const_iterator, const_iterator > _Paircc
Definition: xtree:1008
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
size_type _Tree< _Traits >::count ( const _Other &  _Keyval) const
inline
1539  { // count all elements that match _Keyval
1540  _Paircc _Ans = equal_range(_Keyval);
1541  return (_STD distance(_Ans.first, _Ans.second));
1542  }
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1111
_Pairii equal_range(const key_type &_Keyval)
Definition: xtree:1596
pair< const_iterator, const_iterator > _Paircc
Definition: xtree:1008
template<class _Traits>
const_reverse_iterator _Tree< _Traits >::crbegin ( ) const
inline
1165  { // return iterator for beginning of reversed nonmutable sequence
1166  return (rbegin());
1167  }
reverse_iterator rbegin() _NOEXCEPT
Definition: xtree:1134
template<class _Traits>
const_reverse_iterator _Tree< _Traits >::crend ( ) const
inline
1170  { // return iterator for end of reversed nonmutable sequence
1171  return (rend());
1172  }
reverse_iterator rend() _NOEXCEPT
Definition: xtree:1144
template<class _Traits>
template<class... _Valty>
_Pairib _Tree< _Traits >::emplace ( _Valty &&...  _Val)
inline
1083  { // try to insert value_type(_Val...), favoring right side
1084  _Nodeptr _Newnode = this->_Buynode(_STD forward<_Valty>(_Val)...);
1085  return (_Insert_nohint(false,
1086  this->_Myval(_Newnode), _Newnode));
1087  }
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
_Nodeptr _Buynode(_Valty &&..._Val)
Definition: xtree:894
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
_Pairib _Insert_nohint(bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1782
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<class... _Valty>
iterator _Tree< _Traits >::emplace_hint ( const_iterator  _Where,
_Valty &&...  _Val 
)
inline
1091  { // insert value_type(_Val...) at _Where
1092  _Nodeptr _Newnode = this->_Buynode(_STD forward<_Valty>(_Val)...);
1093  return (_Insert_hint(_Where,
1094  this->_Myval(_Newnode), _Newnode));
1095  }
iterator _Insert_hint(const_iterator _Where, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1661
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
_Nodeptr _Buynode(_Valty &&..._Val)
Definition: xtree:894
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
bool _Tree< _Traits >::empty ( ) const
inline
1185  { // return true only if sequence is empty
1186  return (size() == 0);
1187  }
size_type size() const _NOEXCEPT
Definition: xtree:1174
template<class _Traits>
iterator _Tree< _Traits >::end ( )
inline
1125  { // return iterator for end of mutable sequence
1126  return (iterator(this->_Myhead(), _STD addressof(this->_Get_data())));
1127  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
const_iterator _Tree< _Traits >::end ( ) const
inline
1130  { // return iterator for end of nonmutable sequence
1131  return (const_iterator(this->_Myhead(), _STD addressof(this->_Get_data())));
1132  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
_Mybase::const_iterator const_iterator
Definition: xtree:998
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
_Pairii _Tree< _Traits >::equal_range ( const key_type _Keyval)
inline
1597  { // find range equivalent to _Keyval in mutable tree
1598  return (_Eqrange(_Keyval));
1599  }
_Paircc _Eqrange(const _Other &_Keyval) const
Definition: xtree:2003
template<class _Traits>
_Paircc _Tree< _Traits >::equal_range ( const key_type _Keyval) const
inline
1602  { // find range equivalent to _Keyval in nonmutable tree
1603  return (_Eqrange(_Keyval));
1604  }
_Paircc _Eqrange(const _Other &_Keyval) const
Definition: xtree:2003
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
_Pairii _Tree< _Traits >::equal_range ( const _Other &  _Keyval)
inline
1610  { // find range equivalent to _Keyval in mutable tree
1611  return (_Eqrange(_Keyval));
1612  }
_Paircc _Eqrange(const _Other &_Keyval) const
Definition: xtree:2003
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
_Paircc _Tree< _Traits >::equal_range ( const _Other &  _Keyval) const
inline
1618  { // find range equivalent to _Keyval in nonmutable tree
1619  return (_Eqrange(_Keyval));
1620  }
_Paircc _Eqrange(const _Other &_Keyval) const
Definition: xtree:2003
template<class _Traits>
iterator _Tree< _Traits >::erase ( const_iterator  _Where)
inline
1264  { // erase element at _Where
1265  #if _ITERATOR_DEBUG_LEVEL == 2
1266  if (_Where._Getcont() != _STD addressof(this->_Get_data())
1267  || this->_Isnil(_Where._Mynode()))
1268  {
1269  _DEBUG_ERROR("map/set erase iterator outside range");
1270  }
1271 
1272  _Nodeptr _Erasednode = _Where._Mynode(); // node to erase
1273  ++_Where; // save successor iterator for return
1274  _Orphan_ptr(_Erasednode);
1275 
1276  #else /* _ITERATOR_DEBUG_LEVEL == 2 */
1277  _Nodeptr _Erasednode = _Where._Mynode(); // node to erase
1278  ++_Where; // save successor iterator for return
1279  #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
1280 
1281  _Nodeptr _Fixnode; // the node to recolor as needed
1282  _Nodeptr _Fixnodeparent; // parent of _Fixnode (which may be nil)
1283  _Nodeptr _Pnode = _Erasednode;
1284 
1285  if (this->_Isnil(this->_Left(_Pnode)))
1286  _Fixnode = this->_Right(_Pnode); // stitch up right subtree
1287  else if (this->_Isnil(this->_Right(_Pnode)))
1288  _Fixnode = this->_Left(_Pnode); // stitch up left subtree
1289  else
1290  { // two subtrees, must lift successor node to replace erased
1291  _Pnode = _Where._Mynode(); // _Pnode is successor node
1292  _Fixnode = this->_Right(_Pnode); // _Fixnode is only subtree
1293  }
1294 
1295  if (_Pnode == _Erasednode)
1296  { // at most one subtree, relink it
1297  _Fixnodeparent = this->_Parent(_Erasednode);
1298  if (!this->_Isnil(_Fixnode))
1299  this->_Parent(_Fixnode) = _Fixnodeparent; // link up
1300 
1301  if (_Root() == _Erasednode)
1302  _Root() = _Fixnode; // link down from root
1303  else if (this->_Left(_Fixnodeparent) == _Erasednode)
1304  this->_Left(_Fixnodeparent) = _Fixnode; // link down to left
1305  else
1306  this->_Right(_Fixnodeparent) =
1307  _Fixnode; // link down to right
1308 
1309  if (_Lmost() == _Erasednode)
1310  _Lmost() = this->_Isnil(_Fixnode)
1311  ? _Fixnodeparent // smallest is parent of erased node
1312  : this->_Min(_Fixnode); // smallest in relinked subtree
1313 
1314  if (_Rmost() == _Erasednode)
1315  _Rmost() = this->_Isnil(_Fixnode)
1316  ? _Fixnodeparent // largest is parent of erased node
1317  : this->_Max(_Fixnode); // largest in relinked subtree
1318  }
1319  else
1320  { // erased has two subtrees, _Pnode is successor to erased
1321  this->_Parent(this->_Left(_Erasednode)) =
1322  _Pnode; // link left up
1323  this->_Left(_Pnode) =
1324  this->_Left(_Erasednode); // link successor down
1325 
1326  if (_Pnode == this->_Right(_Erasednode))
1327  _Fixnodeparent = _Pnode; // successor is next to erased
1328  else
1329  { // successor further down, link in place of erased
1330  _Fixnodeparent =
1331  this->_Parent(_Pnode); // parent is successor's
1332  if (!this->_Isnil(_Fixnode))
1333  this->_Parent(_Fixnode) = _Fixnodeparent; // link fix up
1334  this->_Left(_Fixnodeparent) = _Fixnode; // link fix down
1335  this->_Right(_Pnode) =
1336  this->_Right(_Erasednode); // link next down
1337  this->_Parent(this->_Right(_Erasednode)) =
1338  _Pnode; // right up
1339  }
1340 
1341  if (_Root() == _Erasednode)
1342  _Root() = _Pnode; // link down from root
1343  else if (this->_Left(this->_Parent(_Erasednode)) == _Erasednode)
1344  this->_Left(this->_Parent(_Erasednode)) =
1345  _Pnode; // link down to left
1346  else
1347  this->_Right(this->_Parent(_Erasednode)) =
1348  _Pnode; // link down to right
1349 
1350  this->_Parent(_Pnode) =
1351  this->_Parent(_Erasednode); // link successor up
1352  _STD swap(this->_Color(_Pnode),
1353  this->_Color(_Erasednode)); // recolor it
1354  }
1355 
1356  if (this->_Color(_Erasednode) == this->_Black)
1357  { // erasing black link, must recolor/rebalance tree
1358  for (; _Fixnode != _Root()
1359  && this->_Color(_Fixnode) == this->_Black;
1360  _Fixnodeparent = this->_Parent(_Fixnode))
1361  if (_Fixnode == this->_Left(_Fixnodeparent))
1362  { // fixup left subtree
1363  _Pnode = this->_Right(_Fixnodeparent);
1364  if (this->_Color(_Pnode) == this->_Red)
1365  { // rotate red up from right subtree
1366  this->_Color(_Pnode) = this->_Black;
1367  this->_Color(_Fixnodeparent) = this->_Red;
1368  _Lrotate(_Fixnodeparent);
1369  _Pnode = this->_Right(_Fixnodeparent);
1370  }
1371 
1372  if (this->_Isnil(_Pnode))
1373  _Fixnode = _Fixnodeparent; // shouldn't happen
1374  else if (this->_Color(this->_Left(_Pnode)) == this->_Black
1375  && this->_Color(this->_Right(_Pnode)) == this->_Black)
1376  { // redden right subtree with black children
1377  this->_Color(_Pnode) = this->_Red;
1378  _Fixnode = _Fixnodeparent;
1379  }
1380  else
1381  { // must rearrange right subtree
1382  if (this->_Color(this->_Right(_Pnode))
1383  == this->_Black)
1384  { // rotate red up from left sub-subtree
1385  this->_Color(this->_Left(_Pnode)) = this->_Black;
1386  this->_Color(_Pnode) = this->_Red;
1387  _Rrotate(_Pnode);
1388  _Pnode = this->_Right(_Fixnodeparent);
1389  }
1390 
1391  this->_Color(_Pnode) = this->_Color(_Fixnodeparent);
1392  this->_Color(_Fixnodeparent) = this->_Black;
1393  this->_Color(this->_Right(_Pnode)) = this->_Black;
1394  _Lrotate(_Fixnodeparent);
1395  break; // tree now recolored/rebalanced
1396  }
1397  }
1398  else
1399  { // fixup right subtree
1400  _Pnode = this->_Left(_Fixnodeparent);
1401  if (this->_Color(_Pnode) == this->_Red)
1402  { // rotate red up from left subtree
1403  this->_Color(_Pnode) = this->_Black;
1404  this->_Color(_Fixnodeparent) = this->_Red;
1405  _Rrotate(_Fixnodeparent);
1406  _Pnode = this->_Left(_Fixnodeparent);
1407  }
1408 
1409  if (this->_Isnil(_Pnode))
1410  _Fixnode = _Fixnodeparent; // shouldn't happen
1411  else if (this->_Color(this->_Right(_Pnode)) ==
1412  this->_Black
1413  && this->_Color(this->_Left(_Pnode)) == this->_Black)
1414  { // redden left subtree with black children
1415  this->_Color(_Pnode) = this->_Red;
1416  _Fixnode = _Fixnodeparent;
1417  }
1418  else
1419  { // must rearrange left subtree
1420  if (this->_Color(this->_Left(_Pnode)) == this->_Black)
1421  { // rotate red up from right sub-subtree
1422  this->_Color(this->_Right(_Pnode)) = this->_Black;
1423  this->_Color(_Pnode) = this->_Red;
1424  _Lrotate(_Pnode);
1425  _Pnode = this->_Left(_Fixnodeparent);
1426  }
1427 
1428  this->_Color(_Pnode) = this->_Color(_Fixnodeparent);
1429  this->_Color(_Fixnodeparent) = this->_Black;
1430  this->_Color(this->_Left(_Pnode)) = this->_Black;
1431  _Rrotate(_Fixnodeparent);
1432  break; // tree now recolored/rebalanced
1433  }
1434  }
1435 
1436  this->_Color(_Fixnode) = this->_Black; // stopping node is black
1437  }
1438 
1439  this->_Getal().destroy(
1440  _STD addressof(this->_Myval(_Erasednode))); // delete erased node
1441 
1442  this->_Getal().deallocate(_Erasednode, 1);
1443 
1444  if (0 < this->_Mysize())
1445  --this->_Mysize();
1446 
1447  return (iterator(_Where._Ptr,
1448  _STD addressof(this->_Get_data()))); // return successor iterator
1449  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
void _Lrotate(_Nodeptr _Wherenode)
Definition: xtree:2096
static _Nodepref _Left(_Nodeptr _Pnode)
Definition: xtree:664
_Nodeptr & _Lmost() const
Definition: xtree:2091
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
Definition: xtree:651
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
static _Nodepref _Parent(_Nodeptr _Pnode)
Definition: xtree:669
_Nodeptr & _Rmost() const
Definition: xtree:2116
void swap(_Myt &_Right)
Definition: xtree:1622
Definition: xtree:651
void _Rrotate(_Nodeptr _Wherenode)
Definition: xtree:2126
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
static _Nodeptr _Max(_Nodeptr _Pnode)
Definition: xtree:684
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
static _Nodeptr _Min(_Nodeptr _Pnode)
Definition: xtree:689
_Mybase::_Nodeptr _Nodeptr
Definition: xtree:984
static char & _Isnil(_Nodeptr _Pnode)
Definition: xtree:659
static char & _Color(_Nodeptr _Pnode)
Definition: xtree:654
_Nodeptr & _Root() const
Definition: xtree:2121
static reference _Myval(_Nodeptr _Pnode)
Definition: xtree:679
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
template<class _Traits>
iterator _Tree< _Traits >::erase ( const_iterator  _First,
const_iterator  _Last 
)
inline
1452  { // erase [_First, _Last)
1453  if (_First == begin() && _Last == end())
1454  { // erase all
1455  clear();
1456  return (begin());
1457  }
1458  else
1459  { // partial erase, one at a time
1460  while (_First != _Last)
1461  erase(_First++);
1462  return (iterator(_First._Ptr, _STD addressof(this->_Get_data())));
1463  }
1464  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
iterator end() _NOEXCEPT
Definition: xtree:1124
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
void clear() _NOEXCEPT
Definition: xtree:1474
iterator erase(const_iterator _Where)
Definition: xtree:1263
iterator begin() _NOEXCEPT
Definition: xtree:1114
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_FwdIt _Last
Definition: algorithm:1936
template<class _Traits>
size_type _Tree< _Traits >::erase ( const key_type _Keyval)
inline
1467  { // erase and count all that match _Keyval
1468  _Pairii _Where = equal_range(_Keyval);
1469  size_type _Num = _STD distance(_Where.first, _Where.second);
1470  erase(_Where.first, _Where.second);
1471  return (_Num);
1472  }
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1111
_Pairii equal_range(const key_type &_Keyval)
Definition: xtree:1596
iterator erase(const_iterator _Where)
Definition: xtree:1263
pair< iterator, iterator > _Pairii
Definition: xtree:1007
_Mybase::size_type size_type
Definition: xtree:991
template<class _Traits>
iterator _Tree< _Traits >::find ( const key_type _Keyval)
inline
1488  { // find an element in mutable sequence that matches _Keyval
1489  iterator _Where = lower_bound(_Keyval);
1490  return (_Where == end()
1491  || _DEBUG_LT_PRED(this->_Getcomp(),
1492  _Keyval, this->_Key(_Where._Mynode()))
1493  ? end() : _Where);
1494  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
iterator lower_bound(const key_type &_Keyval)
Definition: xtree:1544
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
Definition: xutility:565
iterator end() _NOEXCEPT
Definition: xtree:1124
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
template<class _Traits>
const_iterator _Tree< _Traits >::find ( const key_type _Keyval) const
inline
1497  { // find an element in nonmutable sequence that matches _Keyval
1498  const_iterator _Where = lower_bound(_Keyval);
1499  return (_Where == end()
1500  || _DEBUG_LT_PRED(this->_Getcomp(),
1501  _Keyval, this->_Key(_Where._Mynode()))
1502  ? end() : _Where);
1503  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
iterator lower_bound(const key_type &_Keyval)
Definition: xtree:1544
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
_Mybase::const_iterator const_iterator
Definition: xtree:998
iterator end() _NOEXCEPT
Definition: xtree:1124
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
iterator _Tree< _Traits >::find ( const _Other &  _Keyval)
inline
1509  { // find an element in mutable sequence that matches _Keyval
1510  iterator _Where = lower_bound(_Keyval);
1511  return (_Where == end()
1512  || _DEBUG_LT_PRED(this->_Getcomp(),
1513  _Keyval, this->_Key(_Where._Mynode()))
1514  ? end() : _Where);
1515  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
iterator lower_bound(const key_type &_Keyval)
Definition: xtree:1544
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
Definition: xutility:565
iterator end() _NOEXCEPT
Definition: xtree:1124
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
const_iterator _Tree< _Traits >::find ( const _Other &  _Keyval) const
inline
1521  { // find an element in nonmutable sequence that matches _Keyval
1522  const_iterator _Where = lower_bound(_Keyval);
1523  return (_Where == end()
1524  || _DEBUG_LT_PRED(this->_Getcomp(),
1525  _Keyval, this->_Key(_Where._Mynode()))
1526  ? end() : _Where);
1527  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
iterator lower_bound(const key_type &_Keyval)
Definition: xtree:1544
#define _DEBUG_LT_PRED(pred, x, y)
Definition: xutility:900
_Mybase::const_iterator const_iterator
Definition: xtree:998
iterator end() _NOEXCEPT
Definition: xtree:1124
const key_type & _Key(_Nodeptr _Pnode) const
Definition: xtree:2192
template<class _Traits>
allocator_type _Tree< _Traits >::get_allocator ( ) const
inline
1190  { // return allocator object for values
1191  allocator_type _Ret(this->_Getal());
1192  return (_Ret);
1193  }
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
_Mybase::allocator_type allocator_type
Definition: xtree:988
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib _Tree< _Traits >::insert ( const value_type _Val)
inline
1208  { // try to insert node with value _Val, favoring right side
1209  return (_Insert_nohint(false,
1210  _Val, _Nil()));
1211  }
Definition: xtr1common:16
_Pairib _Insert_nohint(bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1782
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator _Tree< _Traits >::insert ( const value_type _Val)
inline
1216  { // try to insert node with value _Val, favoring right side
1217  return (_Insert_nohint(false,
1218  _Val, _Nil()).first);
1219  }
Definition: xtr1common:16
_Pairib _Insert_nohint(bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1782
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t<!_Multi2, int > = 0>
_Pairib _Tree< _Traits >::insert ( value_type &&  _Val)
inline
1224  { // try to insert node with value _Val, favoring right side
1225  return (_Insert_nohint(false,
1226  _STD move(_Val), _Nil()));
1227  }
Definition: xtr1common:16
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Pairib _Insert_nohint(bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1782
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<bool _Multi2 = _Multi, enable_if_t< _Multi2, int > = 0>
iterator _Tree< _Traits >::insert ( value_type &&  _Val)
inline
1232  { // try to insert node with value _Val, favoring right side
1233  return (_Insert_nohint(false,
1234  _STD move(_Val), _Nil()).first);
1235  }
Definition: xtr1common:16
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Pairib _Insert_nohint(bool _Leftish, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1782
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
iterator _Tree< _Traits >::insert ( const_iterator  _Where,
const value_type _Val 
)
inline
1239  { // try to insert node with value _Val using _Where as a hint
1240  return (_Insert_hint(_Where,
1241  _Val, _Nil()));
1242  }
iterator _Insert_hint(const_iterator _Where, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1661
Definition: xtr1common:16
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
iterator _Tree< _Traits >::insert ( const_iterator  _Where,
value_type &&  _Val 
)
inline
1245  { // try to insert node with value _Val using _Where as a hint
1246  return (_Insert_hint(_Where,
1247  _STD move(_Val), _Nil()));
1248  }
iterator _Insert_hint(const_iterator _Where, _Valty &&_Val, _Nodety _Newnode)
Definition: xtree:1661
Definition: xtr1common:16
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _Traits>
template<class _Iter >
void _Tree< _Traits >::insert ( _Iter  _First,
_Iter  _Last 
)
inline
1252  { // insert [_First, _Last) one at a time
1253  _DEBUG_RANGE(_First, _Last);
1254  for (; _First != _Last; ++_First)
1255  emplace_hint(end(), *_First);
1256  }
iterator emplace_hint(const_iterator _Where, _Valty &&..._Val)
Definition: xtree:1090
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
iterator end() _NOEXCEPT
Definition: xtree:1124
_FwdIt _Last
Definition: algorithm:1936
template<class _Traits>
void _Tree< _Traits >::insert ( initializer_list< value_type _Ilist)
inline
1259  { // insert initializer_list
1260  insert(_Ilist.begin(), _Ilist.end());
1261  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Pairib insert(const value_type &_Val)
Definition: xtree:1207
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Traits>
key_compare _Tree< _Traits >::key_comp ( ) const
inline
1196  { // return object for comparing keys
1197  return (this->_Getcomp());
1198  }
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
template<class _Traits>
iterator _Tree< _Traits >::lower_bound ( const key_type _Keyval)
inline
1545  { // find leftmost node not less than _Keyval in mutable tree
1546  return (iterator(_Lbound(_Keyval), _STD addressof(this->_Get_data())));
1547  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_Nodeptr _Lbound(const _Other &_Keyval) const
Definition: xtree:2074
template<class _Traits>
const_iterator _Tree< _Traits >::lower_bound ( const key_type _Keyval) const
inline
1550  { // find leftmost node not less than _Keyval in nonmutable tree
1551  return (const_iterator(_Lbound(_Keyval), _STD addressof(this->_Get_data())));
1552  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Mybase::const_iterator const_iterator
Definition: xtree:998
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_Nodeptr _Lbound(const _Other &_Keyval) const
Definition: xtree:2074
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
iterator _Tree< _Traits >::lower_bound ( const _Other &  _Keyval)
inline
1558  { // find leftmost node not less than _Keyval in mutable tree
1559  return (iterator(_Lbound(_Keyval), _STD addressof(this->_Get_data())));
1560  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_Nodeptr _Lbound(const _Other &_Keyval) const
Definition: xtree:2074
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
const_iterator _Tree< _Traits >::lower_bound ( const _Other &  _Keyval) const
inline
1566  { // find leftmost node not less than _Keyval in nonmutable tree
1567  return (const_iterator(_Lbound(_Keyval), _STD addressof(this->_Get_data())));
1568  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Mybase::const_iterator const_iterator
Definition: xtree:998
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
_Nodeptr _Lbound(const _Other &_Keyval) const
Definition: xtree:2074
template<class _Traits>
size_type _Tree< _Traits >::max_size ( ) const
inline
1180  { // return maximum possible length of sequence
1181  return (this->_Getal().max_size());
1182  }
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
size_type max_size() const _NOEXCEPT
Definition: xtree:1179
template<class _Traits>
_Myt& _Tree< _Traits >::operator= ( _Myt &&  _Right)
inline
1053  { // assign by moving _Right
1054  if (this != _STD addressof(_Right))
1055  { // different, move it
1056  clear();
1057  this->_Move_alloc(_Right._Getal());
1058  this->_Getcomp() = _Right._Getcomp();
1060  typename _Alty::propagate_on_container_move_assignment());
1061  }
1062  return (*this);
1063  }
void _Assign_rv(_Myt &&_Right, true_type)
Definition: xtree:1065
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
void _Move_alloc(_Alty &_Al)
Definition: xtree:802
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
void clear() _NOEXCEPT
Definition: xtree:1474
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Traits>
_Myt& _Tree< _Traits >::operator= ( const _Myt _Right)
inline
1103  { // replace contents from _Right
1104  if (this != _STD addressof(_Right))
1105  { // different, assign it
1106  clear();
1107  this->_Copy_alloc(_Right._Getal());
1108  this->_Getcomp() = _Right._Getcomp();
1109  _Copy(_Right, _Copy_tag());
1110  }
1111  return (*this);
1112  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
void clear() _NOEXCEPT
Definition: xtree:1474
void _Copy(const _Myt &_Right, _Moveit _Movefl)
Definition: xtree:1935
void _Copy_alloc(const _Alty &_Al)
Definition: xtree:783
template<class _Traits>
reverse_iterator _Tree< _Traits >::rbegin ( )
inline
1135  { // return iterator for beginning of reversed mutable sequence
1136  return (reverse_iterator(end()));
1137  }
iterator end() _NOEXCEPT
Definition: xtree:1124
_STD reverse_iterator< iterator > reverse_iterator
Definition: xtree:1003
template<class _Traits>
const_reverse_iterator _Tree< _Traits >::rbegin ( ) const
inline
1140  { // return iterator for beginning of reversed nonmutable sequence
1141  return (const_reverse_iterator(end()));
1142  }
iterator end() _NOEXCEPT
Definition: xtree:1124
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xtree:1004
template<class _Traits>
reverse_iterator _Tree< _Traits >::rend ( )
inline
1145  { // return iterator for end of reversed mutable sequence
1146  return (reverse_iterator(begin()));
1147  }
iterator begin() _NOEXCEPT
Definition: xtree:1114
_STD reverse_iterator< iterator > reverse_iterator
Definition: xtree:1003
template<class _Traits>
const_reverse_iterator _Tree< _Traits >::rend ( ) const
inline
1150  { // return iterator for end of reversed nonmutable sequence
1151  return (const_reverse_iterator(begin()));
1152  }
iterator begin() _NOEXCEPT
Definition: xtree:1114
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xtree:1004
template<class _Traits>
size_type _Tree< _Traits >::size ( ) const
inline
1175  { // return length of sequence
1176  return (this->_Mysize());
1177  }
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
template<class _Traits>
void _Tree< _Traits >::swap ( _Myt _Right)
inline
1623  { // exchange contents with _Right
1624  if (this != _STD addressof(_Right))
1625  { // (maybe) swap allocators, swap control information
1626  _Pocs(this->_Getal(), _Right._Getal());
1627  this->_Swap_all(_Right);
1628  _Swap_adl(this->_Getcomp(), _Right._Getcomp());
1629  _Swap_adl(this->_Myhead(), _Right._Myhead());
1630  _STD swap(this->_Mysize(), _Right._Mysize());
1631  }
1632  }
void _Swap_all(_Myt &_Right)
Definition: xtree:826
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
key_compare & _Getcomp() _NOEXCEPT
Definition: xtree:913
_Nodeptr & _Myhead() _NOEXCEPT
Definition: xtree:943
static _Nodepref _Right(_Nodeptr _Pnode)
Definition: xtree:674
size_type & _Mysize() _NOEXCEPT
Definition: xtree:953
void swap(_Myt &_Right)
Definition: xtree:1622
_Alty & _Getal() _NOEXCEPT
Definition: xtree:923
void _Swap_adl(_Ty &_Left, _Ty &_Right) _NOEXCEPT_OP(_Is_nothrow_swappable< _Ty >
Definition: utility:73
void _Pocs(_Alty &_Left, _Alty &_Right, true_type) _NOEXCEPT
Definition: xmemory0:1169
template<class _Traits>
iterator _Tree< _Traits >::upper_bound ( const key_type _Keyval)
inline
1571  { // find leftmost node greater than _Keyval in mutable tree
1572  return (iterator(_Ubound(_Keyval), _STD addressof(this->_Get_data())));
1573  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr _Ubound(const _Other &_Keyval) const
Definition: xtree:2147
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
const_iterator _Tree< _Traits >::upper_bound ( const key_type _Keyval) const
inline
1576  { // find leftmost node greater than _Keyval in nonmutable tree
1577  return (const_iterator(_Ubound(_Keyval), _STD addressof(this->_Get_data())));
1578  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr _Ubound(const _Other &_Keyval) const
Definition: xtree:2147
_Mybase::const_iterator const_iterator
Definition: xtree:998
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
iterator _Tree< _Traits >::upper_bound ( const _Other &  _Keyval)
inline
1584  { // find leftmost node greater than _Keyval in mutable tree
1585  return (iterator(_Ubound(_Keyval), _STD addressof(this->_Get_data())));
1586  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr _Ubound(const _Other &_Keyval) const
Definition: xtree:2147
_If< is_same< key_type, value_type >::value, typename _Mybase::const_iterator, typename _Mybase::iterator >::type iterator
Definition: xtree:1001
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
template<class _Other , class _Mycomp = key_compare, class = typename _Mycomp::is_transparent>
const_iterator _Tree< _Traits >::upper_bound ( const _Other &  _Keyval) const
inline
1592  { // find leftmost node greater than _Keyval in nonmutable tree
1593  return (const_iterator(_Ubound(_Keyval), _STD addressof(this->_Get_data())));
1594  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Nodeptr _Ubound(const _Other &_Keyval) const
Definition: xtree:2147
_Mybase::const_iterator const_iterator
Definition: xtree:998
_Tree_val< _Val_types > & _Get_data() _NOEXCEPT
Definition: xtree:933
template<class _Traits>
value_compare _Tree< _Traits >::value_comp ( ) const
inline
1201  { // return object for comparing values
1202  return (value_compare(key_comp()));
1203  }
_Traits::value_compare value_compare
Definition: xtree:978
key_compare key_comp() const
Definition: xtree:1195

The documentation for this class was generated from the following file: