42 template<
typename Pred>
45 split(Pred pred, PB_DS_CLASS_C_DEC& other)
47 PB_DS_ASSERT_VALID((*
this))
48 PB_DS_ASSERT_VALID(other)
51 if (base_type::empty())
53 PB_DS_ASSERT_VALID((*
this))
54 PB_DS_ASSERT_VALID(other)
58 base_type::to_linked_list();
59 node_pointer p_out = base_type::prune(pred);
63 _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0);
66 node_pointer p_next = p_out->m_p_next_sibling;
67 other.make_root_and_link(p_out);
71 PB_DS_ASSERT_VALID(other)
72 node_pointer p_cur = base_type::m_p_root;
74 base_type::m_p_root = 0;
77 node_pointer p_next = p_cur->m_p_next_sibling;
78 make_root_and_link(p_cur);
82 PB_DS_ASSERT_VALID((*
this))
83 PB_DS_ASSERT_VALID(other)
89 join(PB_DS_CLASS_C_DEC& other)
91 PB_DS_ASSERT_VALID((*
this))
92 PB_DS_ASSERT_VALID(other)
94 node_pointer p_other = other.m_p_root;
97 node_pointer p_next = p_other->m_p_next_sibling;
98 make_root_and_link(p_other);
101 base_type::m_size += other.m_size;
106 PB_DS_ASSERT_VALID((*
this))
107 PB_DS_ASSERT_VALID(other)