41#ifdef PB_DS_CLASS_C_DEC
44template<
typename Pred>
47split(Pred pred, PB_DS_CLASS_C_DEC& other)
49 PB_DS_ASSERT_VALID((*
this))
50 PB_DS_ASSERT_VALID(other)
53 if (base_type::empty())
55 PB_DS_ASSERT_VALID((*
this))
56 PB_DS_ASSERT_VALID(other)
60 base_type::to_linked_list();
61 node_pointer p_out = base_type::prune(pred);
65 _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
68 node_pointer p_next = p_out->m_p_next_sibling;
69 other.make_root_and_link(p_out);
73 PB_DS_ASSERT_VALID(other)
74 node_pointer p_cur = base_type::m_p_root;
76 base_type::m_p_root = 0;
79 node_pointer p_next = p_cur->m_p_next_sibling;
80 make_root_and_link(p_cur);
84 PB_DS_ASSERT_VALID((*
this))
85 PB_DS_ASSERT_VALID(other)
91join(PB_DS_CLASS_C_DEC& other)
93 PB_DS_ASSERT_VALID((*
this))
94 PB_DS_ASSERT_VALID(other)
96 node_pointer p_other = other.m_p_root;
99 node_pointer p_next = p_other->m_p_next_sibling;
100 make_root_and_link(p_other);
103 base_type::m_size += other.m_size;
108 PB_DS_ASSERT_VALID((*
this))
109 PB_DS_ASSERT_VALID(other)