30#ifndef _STLP_INTERNAL_TREE_H
31#define _STLP_INTERNAL_TREE_H
53#ifndef _STLP_INTERNAL_ALGOBASE_H
57#ifndef _STLP_INTERNAL_ALLOC_H
61#ifndef _STLP_INTERNAL_ITERATOR_H
65#ifndef _STLP_INTERNAL_CONSTRUCT_H
69#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
81#define _S_rb_tree_red false
82#define _S_rb_tree_black true
104template <
class _Value>
112template <
class _Dummy>
130# if defined (_STLP_USE_TEMPLATE_EXPORT)
145template <
class _Value,
class _Traits>
160#if !defined (_STLP_DEBUG)
204#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
206template <
class _Value,
class _Traits>
217#if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES)
219template <
class _Value,
class _Traits>
231template <
class _Tp,
class _Alloc>
254#if !defined (_STLP_NO_MOVE_SEMANTIC)
258 src.get()._M_empty_initialize();
285#if defined (_STLP_DEBUG)
286# define _Rb_tree _STLP_NON_DBG_NAME(Rb_tree)
289template <
class _Key,
class _Compare,
290 class _Value,
class _KeyOfValue,
class _Traits,
358 {
return _KeyOfValue()(
_S_value(__x));}
406#if !defined (_STLP_NO_MOVE_SEMANTIC)
411 {
src.get()._M_node_count = 0; }
428 {
return const_reverse_iterator(
end()); }
430 const_reverse_iterator
rend()
const
431 {
return const_reverse_iterator(
begin()); }
438 if (this->
empty())
return;
443 else if (this->
empty()) {
464#if defined (_STLP_MEMBER_TEMPLATES)
466 for ( ; __first !=
__last; ++__first)
470 for ( ; __first !=
__last; ++__first)
475 for ( ; __first !=
__last; ++__first)
479 for ( ; __first !=
__last; ++__first)
483 for ( ; __first !=
__last; ++__first)
487 for ( ; __first !=
__last; ++__first)
495 this->_M_header._M_data.
_M_left,
497 _STLP_STD::_Destroy(&
_S_value(__x));
511 if (__i.
_M_node != &this->_M_header._M_data) {
520 __last._M_node == &this->_M_header._M_data)
618 if (__p.
second._M_node != &this->_M_header._M_data &&
631 if (__p.
second._M_node != &this->_M_header._M_data &&
641#if defined (_STLP_DEBUG)
644 bool __rb_verify()
const;
648#if defined (_STLP_DEBUG)
656#if !defined (_STLP_LINK_TIME_INSTANTIATION)
660#if defined (_STLP_DEBUG)
666#define _STLP_TEMPLATE_HEADER template <class _Key, class _Compare, class _Value, class _KeyOfValue, class _Traits, class _Alloc>
667#define _STLP_TEMPLATE_CONTAINER _STLP_PRIV _Rb_tree<_Key,_Compare,_Value,_KeyOfValue,_Traits,_Alloc>
669#undef _STLP_TEMPLATE_CONTAINER
670#undef _STLP_TEMPLATE_HEADER
672#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC)
673template <
class _Key,
class _Compare,
class _Value,
class _KeyOfValue,
class _Traits,
class _Alloc>
#define bidirectional_iterator_tag
_STLP_INLINE_LOOP _InputIter __last
_STLP_INLINE_LOOP _InputIter const _Tp & __val
#define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
#define _STLP_FORCE_ALLOCATORS(a, y)
void _Copy_Construct(_Tp *__p, const _Tp &__val)
_STLP_MOVE_TO_PRIV_NAMESPACE const _InputIterator const input_iterator_tag &_InputIterator __it(__first)
_STLP_TYPENAME_ON_RETURN_TYPE _MoveSourceTraits< _Tp >::_Type _AsMoveSource(_Tp &src)
#define _STLP_DEFINE_ARROW_OPERATOR
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE typedef bool _Rb_tree_Color_type
_Rb_global< bool > _Rb_global_inst
void get(int argc, const char *argv[])
_Rb_tree_node_base * _Base_ptr
static _Base_ptr _STLP_CALL _Rebalance_for_erase(_Base_ptr __z, _Base_ptr &__root, _Base_ptr &__leftmost, _Base_ptr &__rightmost)
static void _STLP_CALL _Rotate_left(_Base_ptr __x, _Base_ptr &__root)
static _Base_ptr _STLP_CALL _M_decrement(_Base_ptr)
static void _STLP_CALL _Rebalance(_Base_ptr __x, _Base_ptr &__root)
static _Base_ptr _STLP_CALL _M_increment(_Base_ptr)
static void _STLP_CALL _Rotate_right(_Base_ptr __x, _Base_ptr &__root)
_Rb_tree_base(const allocator_type &__a)
_Alloc_traits< _Node, _Alloc >::allocator_type _M_node_allocator_type
void _M_rebind(_Node_base *__static_node)
void _M_empty_initialize()
_Rb_tree_node_base _Node_base
_Rb_tree_node< _Tp > _Node
_Rb_tree_base(__move_source< _Self > src)
ptrdiff_t difference_type
_Rb_tree< _Key, _Compare, _Value, _KeyOfValue, _Traits, _Alloc > _Self
_Rb_tree_Color_type _Color_type
_STLP_TEMPLATE_FOR_CONT_EXT const_iterator lower_bound(const _KT &__x) const
_STLP_TEMPLATE_FOR_CONT_EXT iterator lower_bound(const _KT &__x)
_Rb_tree(const _Compare &__comp)
_Rb_tree(__move_source< _Self > src)
_Traits::_NonConstTraits _NonConstTraits
_Base_ptr _M_leftmost() const
_STLP_TEMPLATE_FOR_CONT_EXT pair< const_iterator, const_iterator > equal_range(const _KT &__x) const
_Base_ptr _M_rightmost() const
const_reverse_iterator rbegin() const
_Compare key_comp() const
allocator_type get_allocator() const
_STLP_TEMPLATE_FOR_CONT_EXT const_iterator upper_bound(const _KT &__x) const
_STLP_TEMPLATE_FOR_CONT_EXT pair< iterator, iterator > equal_range(const _KT &__x)
const_iterator begin() const
_Base_ptr _M_clone_node(_Base_ptr __x)
_Base_ptr _M_create_node(const value_type &__x)
_Base_ptr & _M_leftmost()
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__k)
const_reverse_iterator rend() const
void erase(const key_type *__first, const key_type *__last)
void erase(iterator __first, iterator __last)
void insert_equal(const_iterator __first, const_iterator __last)
_STLP_TEMPLATE_FOR_CONT_EXT size_type count(const _KT &__x) const
_STLP_TEMPLATE_FOR_CONT_EXT _Base_ptr _M_lower_bound(const _KT &__k) const
static _Base_ptr _STLP_CALL _S_minimum(_Base_ptr __x)
_STLP_TEMPLATE_FOR_CONT_EXT _Base_ptr _M_find(const _KT &__k) const
_STLP_TEMPLATE_FOR_CONT_EXT const_iterator find(const _KT &__k) const
_STLP_TEMPLATE_FOR_CONT_EXT pair< iterator, iterator > equal_range_unique(const _KT &__x)
reverse_iterator rbegin()
iterator insert_equal(const value_type &__x)
_STLP_TEMPLATE_FOR_CONT_EXT iterator upper_bound(const _KT &__x)
iterator _M_insert(_Base_ptr __parent, const value_type &__val, _Base_ptr __on_left=0, _Base_ptr __on_right=0)
_Traits::reference reference
_Rb_tree_iterator< value_type, _ConstTraits > const_iterator
_Traits::_ConstTraits _ConstTraits
static value_type &_STLP_CALL _S_value(_Base_ptr __x)
_STLP_TEMPLATE_FOR_CONT_EXT pair< const_iterator, const_iterator > equal_range_unique(const _KT &__x) const
_Base::allocator_type allocator_type
_Rb_tree_node_base * _Base_ptr
_STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS
bidirectional_iterator_tag _Iterator_category
pair< iterator, bool > insert_unique(const value_type &__x)
_Base_ptr & _M_rightmost()
void insert_unique(const_iterator __first, const_iterator __last)
const value_type * const_pointer
size_type erase_unique(const key_type &__x)
static _Base_ptr &_STLP_CALL _S_right(_Base_ptr __x)
static _Base_ptr &_STLP_CALL _S_parent(_Base_ptr __x)
void _M_erase(_Base_ptr __x)
size_type erase(const key_type &__x)
_Rb_tree(const _Self &__x)
void insert_equal(const value_type *__first, const value_type *__last)
static _Color_type &_STLP_CALL _S_color(_Base_ptr __x)
_Self & operator=(const _Self &__x)
_Rb_tree(const _Compare &__comp, const allocator_type &__a)
_Base_ptr _M_root() const
const value_type & const_reference
static _Base_ptr &_STLP_CALL _S_left(_Base_ptr __x)
void insert_unique(const value_type *__first, const value_type *__last)
_STLP_TEMPLATE_FOR_CONT_EXT _Base_ptr _M_upper_bound(const _KT &__k) const
static _Base_ptr _STLP_CALL _S_maximum(_Base_ptr __x)
static const _Key &_STLP_CALL _S_key(_Base_ptr __x)
size_type max_size() const
const_iterator end() const
_Rb_tree_base< _Value, _Alloc > _Base
_Base_ptr _M_copy(_Base_ptr __x, _Base_ptr __p)
void erase(iterator __pos)
_Rb_tree_iterator< value_type, _NonConstTraits > iterator
_Rb_tree_node< _Value > _Node
_Tp * allocate(size_type __n, size_type &__allocated_n)
__kernel_ptrdiff_t ptrdiff_t
#define _STLP_UNWIND(action)
#define _STLP_TEMPLATE_FOR_CONT_EXT
#define __TRIVIAL_STUFF(__type)
#define _STLP_MOVE_TO_STD_NAMESPACE
#define _STLP_DFL_TMPL_PARAM(classname, defval)
#define __STATIC_CAST(__x, __y)
#define __CONST_CAST(__x, __y)
#define _STLP_KEY_TYPE_FOR_CONT_EXT(type)
#define _STLP_EXPORT_TEMPLATE_CLASS
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
_Rb_tree_node_base * _Base_ptr
ptrdiff_t difference_type
bidirectional_iterator_tag iterator_category
_Rb_tree_base_iterator(_Base_ptr __x)
bool operator!=(const_iterator __rhs) const
reference operator*() const
_Rb_tree_node< _Value > * _Link_type
_Traits::_ConstTraits _ConstTraits
_Rb_tree_iterator< _Value, _Traits > _Self
_Rb_tree_iterator< _Value, _NonConstTraits > iterator
_Rb_tree_iterator(_Base_ptr __x)
_Rb_tree_node_base * _Base_ptr
_Traits::_NonConstTraits _NonConstTraits
bool operator==(const_iterator __rhs) const
_Traits::reference reference
_Rb_tree_iterator< _Value, _ConstTraits > const_iterator
_Rb_tree_iterator(const iterator &__it)
_STLP_DEFINE_ARROW_OPERATOR _Self & operator++()
_Rb_tree_Color_type _Color_type
_Rb_tree_node_base * _Base_ptr
static _Base_ptr _STLP_CALL _S_maximum(_Base_ptr __x)
static _Base_ptr _STLP_CALL _S_minimum(_Base_ptr __x)
__bool2type< pod >::_Ret is_POD_type
__bool2type< trivial_destructor >::_Ret has_trivial_destructor
__bool2type< trivial_constructor >::_Ret has_trivial_default_constructor
__bool2type< trivial_copy >::_Ret has_trivial_copy_constructor
__bool2type< trivial_assign >::_Ret has_trivial_assignment_operator