summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-07 22:48:50 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2006-09-07 22:48:50 +0000
commit2b31bec458e53ecde8c29b7cf2050492f6590152 (patch)
tree247a242e2b4ff36868d072acef436c650d7340bf /libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
parent67bb1301893570172e9997b9f2242385eddf4f56 (diff)
downloadgcc-2b31bec458e53ecde8c29b7cf2050492f6590152.tar.gz
2006-09-08 Benjamin Kosnik <bkoz@redhat.com>
* include/debug/debug.h (_GLIBCXX_DEBUG_ONLY): New. * include/ext/bitmap_allocator.h (_BALLOC_SANITY_CHECK, _BALLOC_ASSERT): Remove. Use _GLIBCXX_DEBUG, _GLIBCXX_DEBUG_ASSERT. * include/ext/pb_ds/hash_policy.hpp (PB_DS_DBG_ASSERT): Convert to _GLIBCXX_DEBUG_ASSERT. Formatting corrections. (PB_DS_DBG_VERIFY): Remove, unused. (PB_DS_DBG_ONLY): Convert to _GLIBCXX_DEBUG blocks. * include/ext/pb_ds/detail/resize_policy/ hash_load_check_resize_trigger_imp.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ binomial_heap_base_.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_base_/ split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ insert_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ debug_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/cc_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/unordered_iterator/iterator.hpp: Same. * include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp: Same. * include/ext/pb_ds/detail/unordered_iterator/ const_point_iterator.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/head.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/leaf.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/node_base.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/internal_node.hpp: Same. * include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/ split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ erase_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ insert_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ insert_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ debug_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ debug_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ erase_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ resize_no_store_hash_fn_imps.hpp: Same. * include/ext/pb_ds/detail/types_traits.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/resize_policy.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp: Same. * include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp: Same. * include/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ left_child_next_sibling_heap_.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_iterator.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/left_child_next_sibling_heap_/ const_point_iterator.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp: Same. * include/ext/pb_ds/detail/map_debug_base.hpp: Same. * include/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp: Same. * include/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp: Same. * include/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/ constructor_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/list_update_map_/ iterators_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/ rc_binomial_heap_.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp: Same. * include/ext/pb_ds/detail/rc_binomial_heap_/ split_join_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/ constructors_destructor_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp: Same. * include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp: Same. * testsuite/util/regression/res_mng/forced_exception.hpp: Same. * testsuite/util/regression/res_mng/dbg_ex_allocator_base.hpp: Same. * testsuite/util/regression/res_mng/dbg_ex_allocator.hpp: Same. * testsuite/util/rng/twister_rand_gen.cc * testsuite/util/native_type/assoc/native_multimap.hpp: Same. * testsuite/util/native_type/assoc/native_hash_multimap.hpp: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp')
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp174
1 files changed, 50 insertions, 124 deletions
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
index bf320241b1d..275177e10e0 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
@@ -47,10 +47,8 @@
#ifndef PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
#define PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
-#ifdef PB_DS_BIN_SEARCH_TREE_DEBUG_
-#include <cassert>
-#endif // #ifdef PB_DS_BIN_SEARCH_TREE_DEBUG_
#include <ext/pb_ds/tag_and_trait.hpp>
+#include <debug/debug.h>
namespace pb_ds
{
@@ -101,16 +99,6 @@ namespace pb_ds
!Is_Forward_Iterator, \
Allocator>
-#ifdef PB_DS_BIN_SEARCH_TREE_DEBUG_
-#define PB_DS_DBG_ASSERT(X) assert(X)
-#define PB_DS_DBG_VERIFY(X) assert(X)
-#define PB_DS_DBG_ONLY(X) X
-#else // #ifdef PB_DS_BIN_SEARCH_TREE_DEBUG_
-#define PB_DS_DBG_ASSERT(X)
-#define PB_DS_DBG_VERIFY(X) {if((X)==0);}
-#define PB_DS_DBG_ONLY(X) ;
-#endif // #ifdef PB_DS_BIN_SEARCH_TREE_DEBUG_
-
// Const iterator.
template<typename Node_Pointer,
typename Value_Type,
@@ -142,124 +130,96 @@ namespace pb_ds
public:
inline
- bin_search_tree_const_it_(const Node_Pointer p_nd = NULL) : m_p_nd(const_cast<Node_Pointer>(p_nd))
+ bin_search_tree_const_it_(const Node_Pointer p_nd = NULL)
+ : m_p_nd(const_cast<Node_Pointer>(p_nd))
{ }
inline
- bin_search_tree_const_it_(const PB_DS_TREE_CONST_ODIR_IT_C_DEC&
- other) : m_p_nd(other.m_p_nd)
+ bin_search_tree_const_it_(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other)
+ : m_p_nd(other.m_p_nd)
{ }
inline
PB_DS_TREE_CONST_IT_C_DEC&
- operator=(const PB_DS_TREE_CONST_IT_C_DEC&
- other)
+ operator=(const PB_DS_TREE_CONST_IT_C_DEC& other)
{
m_p_nd = other.m_p_nd;
-
- return (*this);
+ return *this;
}
inline
PB_DS_TREE_CONST_IT_C_DEC&
- operator=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC&
- other)
+ operator=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other)
{
m_p_nd = other.m_p_nd;
-
- return (*this);
+ return *this;
}
inline const_pointer
operator->() const
{
- PB_DS_DBG_ASSERT(m_p_nd != NULL);
-
- return (&m_p_nd->m_value);
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return &m_p_nd->m_value;
}
inline const_reference
operator*() const
{
- PB_DS_DBG_ASSERT(m_p_nd != NULL);
-
- return (m_p_nd->m_value);
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
+ return m_p_nd->m_value;
}
inline bool
- operator==(const PB_DS_TREE_CONST_IT_C_DEC
- & other) const
- {
- return (m_p_nd == other.m_p_nd);
- }
+ operator==(const PB_DS_TREE_CONST_IT_C_DEC & other) const
+ { return m_p_nd == other.m_p_nd; }
inline bool
- operator==(const PB_DS_TREE_CONST_ODIR_IT_C_DEC
- & other) const
- {
- return (m_p_nd == other.m_p_nd);
- }
+ operator==(const PB_DS_TREE_CONST_ODIR_IT_C_DEC & other) const
+ { return m_p_nd == other.m_p_nd; }
inline bool
- operator!=(const PB_DS_TREE_CONST_IT_C_DEC&
- other) const
- {
- return (m_p_nd != other.m_p_nd);
- }
+ operator!=(const PB_DS_TREE_CONST_IT_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
inline bool
- operator!=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC&
- other) const
- {
- return (m_p_nd != other.m_p_nd);
- }
+ operator!=(const PB_DS_TREE_CONST_ODIR_IT_C_DEC& other) const
+ { return m_p_nd != other.m_p_nd; }
inline PB_DS_TREE_CONST_IT_C_DEC&
operator++()
{
- PB_DS_DBG_ASSERT(m_p_nd != NULL);
-
+ _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL);
inc(integral_constant<int,Is_Forward_Iterator>());
-
- return (*this);
+ return *this;
}
inline PB_DS_TREE_CONST_IT_C_DEC
operator++(int)
{
- PB_DS_TREE_CONST_IT_C_DEC
- ret_it(m_p_nd);
-
+ PB_DS_TREE_CONST_IT_C_DEC ret_it(m_p_nd);
operator++();
-
- return (ret_it);
+ return ret_it;
}
inline PB_DS_TREE_CONST_IT_C_DEC&
operator--()
{
dec(integral_constant<int,Is_Forward_Iterator>());
-
- return (*this);
+ return *this;
}
inline PB_DS_TREE_CONST_IT_C_DEC
operator--(int)
{
- PB_DS_TREE_CONST_IT_C_DEC
- ret_it(m_p_nd);
-
+ PB_DS_TREE_CONST_IT_C_DEC ret_it(m_p_nd);
operator--();
-
- return (ret_it);
+ return ret_it;
}
protected:
inline void
inc(false_type)
- {
- dec(true_type());
- }
+ { dec(true_type()); }
void
inc(true_type)
@@ -268,26 +228,21 @@ namespace pb_ds
m_p_nd->m_p_parent->m_p_parent == m_p_nd)
{
m_p_nd = m_p_nd->m_p_left;
-
return;
}
if (m_p_nd->m_p_right != NULL)
{
m_p_nd = m_p_nd->m_p_right;
-
while (m_p_nd->m_p_left != NULL)
m_p_nd = m_p_nd->m_p_left;
-
return;
}
Node_Pointer p_y = m_p_nd->m_p_parent;
-
while (m_p_nd == p_y->m_p_right)
{
m_p_nd = p_y;
-
p_y = p_y->m_p_parent;
}
@@ -297,42 +252,32 @@ namespace pb_ds
inline void
dec(false_type)
- {
- inc(true_type());
- }
+ { inc(true_type()); }
void
dec(true_type)
{
- if (m_p_nd->special()&&
- m_p_nd->m_p_parent->m_p_parent == m_p_nd)
+ if (m_p_nd->special() && m_p_nd->m_p_parent->m_p_parent == m_p_nd)
{
m_p_nd = m_p_nd->m_p_right;
-
return;
}
if (m_p_nd->m_p_left != NULL)
{
Node_Pointer p_y = m_p_nd->m_p_left;
-
while (p_y->m_p_right != NULL)
p_y = p_y->m_p_right;
-
m_p_nd = p_y;
-
return;
}
Node_Pointer p_y = m_p_nd->m_p_parent;
-
while (m_p_nd == p_y->m_p_left)
{
m_p_nd = p_y;
-
p_y = p_y->m_p_parent;
}
-
if (m_p_nd->m_p_left != p_y)
m_p_nd = p_y;
}
@@ -358,11 +303,13 @@ namespace pb_ds
public:
inline
- bin_search_tree_it_(const Node_Pointer p_nd = NULL) : PB_DS_TREE_CONST_IT_C_DEC((Node_Pointer)p_nd)
+ bin_search_tree_it_(const Node_Pointer p_nd = NULL)
+ : PB_DS_TREE_CONST_IT_C_DEC((Node_Pointer)p_nd)
{ }
inline
- bin_search_tree_it_(const PB_DS_TREE_ODIR_IT_C_DEC& other) : PB_DS_TREE_CONST_IT_C_DEC(other.m_p_nd)
+ bin_search_tree_it_(const PB_DS_TREE_ODIR_IT_C_DEC& other)
+ : PB_DS_TREE_CONST_IT_C_DEC(other.m_p_nd)
{ }
inline
@@ -370,8 +317,7 @@ namespace pb_ds
operator=(const PB_DS_TREE_IT_C_DEC& other)
{
base_it_type::m_p_nd = other.m_p_nd;
-
- return (*this);
+ return *this;
}
inline
@@ -379,64 +325,51 @@ namespace pb_ds
operator=(const PB_DS_TREE_ODIR_IT_C_DEC& other)
{
base_it_type::m_p_nd = other.m_p_nd;
-
- return (*this);
+ return *this;
}
inline typename PB_DS_TREE_CONST_IT_C_DEC::pointer
operator->() const
{
- PB_DS_DBG_ASSERT(base_it_type::m_p_nd != NULL);
-
- return (&base_it_type::m_p_nd->m_value);
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL);
+ return &base_it_type::m_p_nd->m_value;
}
inline typename PB_DS_TREE_CONST_IT_C_DEC::reference
operator*() const
{
- PB_DS_DBG_ASSERT(base_it_type::m_p_nd != NULL);
-
- return (base_it_type::m_p_nd->m_value);
+ _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL);
+ return base_it_type::m_p_nd->m_value;
}
inline PB_DS_TREE_IT_C_DEC&
operator++()
{
- PB_DS_TREE_CONST_IT_C_DEC::
- operator++();
-
- return (*this);
+ PB_DS_TREE_CONST_IT_C_DEC:: operator++();
+ return *this;
}
inline PB_DS_TREE_IT_C_DEC
operator++(int)
{
- PB_DS_TREE_IT_C_DEC
- ret_it(base_it_type::m_p_nd);
-
+ PB_DS_TREE_IT_C_DEC ret_it(base_it_type::m_p_nd);
operator++();
-
- return (ret_it);
+ return ret_it;
}
inline PB_DS_TREE_IT_C_DEC&
operator--()
{
- PB_DS_TREE_CONST_IT_C_DEC::
- operator--();
-
- return (*this);
+ PB_DS_TREE_CONST_IT_C_DEC:: operator--();
+ return *this;
}
inline PB_DS_TREE_IT_C_DEC
operator--(int)
{
- PB_DS_TREE_IT_C_DEC
- ret_it(base_it_type::m_p_nd);
-
+ PB_DS_TREE_IT_C_DEC ret_it(base_it_type::m_p_nd);
operator--();
-
- return (ret_it);
+ return ret_it;
}
protected:
@@ -444,18 +377,11 @@ namespace pb_ds
};
#undef PB_DS_TREE_CONST_IT_C_DEC
-
#undef PB_DS_TREE_CONST_ODIR_IT_C_DEC
-
#undef PB_DS_TREE_IT_C_DEC
-
#undef PB_DS_TREE_ODIR_IT_C_DEC
-#undef PB_DS_DBG_ASSERT
-#undef PB_DS_DBG_VERIFY
-#undef PB_DS_DBG_ONLY
-
} // namespace detail
} // namespace pb_ds
-#endif // #ifndef PB_DS_BIN_SEARCH_TREE_FIND_ITERATORS_HPP
+#endif