41#ifdef PB_DS_CLASS_C_DEC
46insert(const_reference r_value)
48 PB_DS_ASSERT_VALID((*
this))
49 std::pair<point_iterator,
bool> ins_pair = insert_leaf_imp(r_value);
50 ins_pair.first.m_p_nd->m_special = false;
51 PB_DS_ASSERT_VALID((*this))
52 splay(ins_pair.first.m_p_nd);
53 PB_DS_ASSERT_VALID((*this))
58inline
std::pair<typename PB_DS_CLASS_C_DEC::point_iterator,
bool>
60insert_leaf_imp(const_reference r_value)
62 _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid(__FILE__,
64 if (base_type::m_size == 0)
65 return
std::make_pair(base_type::insert_imp_empty(r_value), true);
67 node_pointer p_nd = base_type::m_p_head->m_p_parent;
68 node_pointer p_pot = base_type::m_p_head;
71 if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), PB_DS_V2F(r_value)))
73 if (!Cmp_Fn::operator()(PB_DS_V2F(r_value), PB_DS_V2F(p_nd->m_value)))
75 return std::make_pair(point_iterator(p_nd),
false);
78 p_nd = p_nd->m_p_left;
81 p_nd = p_nd->m_p_right;
83 if (p_pot == base_type::m_p_head)
84 return std::make_pair(base_type::insert_leaf_new(r_value, base_type::m_p_head->m_p_right,
false),
true);
86 PB_DS_CHECK_KEY_DOES_NOT_EXIST(PB_DS_V2F(r_value))
88 p_nd = p_pot->m_p_left;
90 return (std::make_pair(base_type::insert_leaf_new(r_value, p_pot,
true),
true));
92 while (p_nd->m_p_right != 0)
93 p_nd = p_nd->m_p_right;
95 return std::make_pair(this->insert_leaf_new(r_value, p_nd,
false),
true);
ISO C++ entities toplevel namespace is std.
Struct holding two objects of arbitrary type.