44 split(key_const_reference r_key, PB_DS_CLASS_C_DEC& other)
46 PB_DS_ASSERT_VALID((*
this))
47 PB_DS_ASSERT_VALID(other)
55 if (Cmp_Fn::operator()(r_key, PB_DS_V2F(*
begin())))
58 PB_DS_ASSERT_VALID((*
this))
59 PB_DS_ASSERT_VALID(other)
63 if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(*(
end() - 1))))
71 PB_DS_ASSERT_VALID((*
this))
72 PB_DS_ASSERT_VALID(other)
76 iterator it = upper_bound(r_key);
77 PB_DS_CLASS_C_DEC new_other(other, other);
78 new_other.copy_from_ordered_range(it,
end());
79 PB_DS_CLASS_C_DEC new_this(*this, *this);
80 new_this.copy_from_ordered_range(
begin(), it);
83 other.update(other.node_begin(), (node_update*)(&other));
84 update(node_begin(), (node_update*)this);
85 other.value_swap(new_other);
87 PB_DS_ASSERT_VALID((*this))
88 PB_DS_ASSERT_VALID(other)
94 join(PB_DS_CLASS_C_DEC& other)
96 PB_DS_ASSERT_VALID((*
this))
97 PB_DS_ASSERT_VALID(other)
98 if (other.m_size == 0)
104 PB_DS_ASSERT_VALID((*
this))
105 PB_DS_ASSERT_VALID(other)
109 const
bool greater = Cmp_Fn::operator()(PB_DS_V2F(*(end() - 1)),
110 PB_DS_V2F(*other.begin()));
112 const
bool lesser = Cmp_Fn::operator()(PB_DS_V2F(*(other.end() - 1)),
113 PB_DS_V2F(*begin()));
115 if (!greater && !lesser)
116 __throw_join_error();
118 PB_DS_CLASS_C_DEC new_this(*this, *this);
121 new_this.copy_from_ordered_range(begin(), end(),
122 other.begin(), other.end());
124 new_this.copy_from_ordered_range(other.begin(), other.end(),
128 value_swap(new_this);
130 PB_DS_ASSERT_VALID((*this))
131 PB_DS_ASSERT_VALID(other)
auto end(_Container &__cont) -> decltype(__cont.end())
Return an iterator pointing to one past the last element of the container.
auto begin(_Container &__cont) -> decltype(__cont.begin())
Return an iterator pointing to the first element of the container.