41#ifndef PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
42#define PB_DS_BIN_SEARCH_TREE_NODE_ITERATORS_HPP
50#define PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC \
51 bin_search_tree_const_node_it_<Node, Const_Iterator, Iterator, _Alloc>
54 template<
typename Node,
83 typedef typename rebind_traits<_Alloc, metadata_type>::const_reference
88 : m_p_nd(const_cast<node_pointer>(p_nd))
94 {
return Const_Iterator(m_p_nd); }
99 {
return m_p_nd->get_metadata(); }
102 PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
104 {
return PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_left); }
107 PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
109 {
return PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(m_p_nd->m_p_right); }
113 operator==(
const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other)
const
114 {
return m_p_nd == other.m_p_nd; }
118 operator!=(
const PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC& other)
const
119 {
return m_p_nd != other.m_p_nd; }
124#define PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC \
125 bin_search_tree_node_it_<Node, Const_Iterator, Iterator, _Alloc>
128 template<
typename Node,
129 class Const_Iterator,
133 :
public PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
150 : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC(const_cast<node_pointer>(p_nd))
156 {
return Iterator(PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd); }
159 PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
162 return PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
163 PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_left);
167 PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
170 return PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC(
171 PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC::m_p_nd->m_p_right);
176#undef PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC
177#undef PB_DS_TREE_NODE_ITERATOR_CLASS_C_DEC
void trivial_iterator_difference_type
Prohibit moving trivial iterators.
GNU extensions for policy-based data structures for public use.
A trivial iterator tag. Signifies that the iterators has none of std::iterators's movement abilities.
Consistent API for accessing allocator-related types.
Const_Iterator reference
Iterator's reference type.
rebind_traits< _Alloc, metadata_type >::const_reference metadata_const_reference
Const metadata reference type.
trivial_iterator_difference_type difference_type
Difference type.
Const_Iterator value_type
Iterator's value type.
bool operator==(const bin_search_tree_const_node_it_< Node, Const_Iterator, Iterator, _Alloc > &other) const
Compares to a different iterator object.
Const_Iterator const_reference
Iterator's __const reference type.
Node::metadata_type metadata_type
Metadata type.
bin_search_tree_const_node_it_< Node, Const_Iterator, Iterator, _Alloc > get_r_child() const
Returns the __const node iterator associated with the right node.
metadata_const_reference get_metadata() const
Metadata access.
trivial_iterator_tag iterator_category
Category.
bin_search_tree_const_node_it_< Node, Const_Iterator, Iterator, _Alloc > get_l_child() const
Returns the __const node iterator associated with the left node.
const_reference operator*() const
Access.
bool operator!=(const bin_search_tree_const_node_it_< Node, Const_Iterator, Iterator, _Alloc > &other) const
Compares (negatively) to a different iterator object.
bin_search_tree_node_it_< Node, Const_Iterator, Iterator, _Alloc > get_r_child() const
Returns the node iterator associated with the right node.
Iterator const_reference
Iterator's __const reference type.
Iterator reference
Iterator's reference type.
bin_search_tree_node_it_< Node, Const_Iterator, Iterator, _Alloc > get_l_child() const
Returns the node iterator associated with the left node.
Iterator operator*() const
Access.
Iterator value_type
Iterator's value type.