forked from boostorg/intrusive
merging intrusive from develop
This commit is contained in:
@@ -98,7 +98,7 @@ int main()
|
||||
|
||||
//Test the objects inserted in our lists
|
||||
for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){
|
||||
if(&*bit1 != &*it1 || &*bit2 != &*it2) return false;
|
||||
if(&*bit1 != &*it1 || &*bit2 != &*it2) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -26,6 +26,9 @@ class MyClass : public any_base_hook<> //Base hook
|
||||
|
||||
MyClass(int i = 0) : int_(i)
|
||||
{}
|
||||
//<-
|
||||
int get_int() const { return int_; }
|
||||
//->
|
||||
};
|
||||
|
||||
int main()
|
||||
|
@@ -87,7 +87,7 @@ int main()
|
||||
|
||||
//Test the objects inserted in our lists
|
||||
for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){
|
||||
if(&*bit1 != &*it1 || &*bit2 != &*it2) return false;
|
||||
if(&*bit1 != &*it1 || &*bit2 != &*it2) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -23,6 +23,9 @@ class MyClass : public list_base_hook<>
|
||||
list_member_hook<> member_hook_;
|
||||
|
||||
MyClass(int i) : int_(i) {}
|
||||
//<-
|
||||
int get_int() const { return int_; }
|
||||
//->
|
||||
};
|
||||
|
||||
//Define a list that will store MyClass using the base hook
|
||||
|
@@ -26,6 +26,9 @@ class MyClass : public list_base_hook<> //This is a derivation hook
|
||||
MyClass(int i)
|
||||
: int_(i)
|
||||
{}
|
||||
//<-
|
||||
int get_int() const { return int_; }
|
||||
//->
|
||||
};
|
||||
|
||||
//Define a list that will store MyClass using the public base hook
|
||||
|
@@ -88,7 +88,7 @@ int main()
|
||||
|
||||
//Test the objects inserted in our lists
|
||||
for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){
|
||||
if(&*bit1 != &*it1 || &*bit2 != &*it2) return false;
|
||||
if(&*bit1 != &*it1 || &*bit2 != &*it2) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -100,7 +100,7 @@ int main()
|
||||
int checker = 0;
|
||||
for( intrusive_list_t::const_iterator it = plist->begin(), itend(plist->end())
|
||||
; it != itend; ++it, ++checker){
|
||||
if(it->get() != checker) return false;
|
||||
if(it->get() != checker) return 1;
|
||||
}
|
||||
|
||||
//Now delete the list and after that, the nodes
|
||||
|
@@ -27,6 +27,9 @@ class MyClass : public slist_base_hook<>
|
||||
MyClass(int i)
|
||||
: int_(i)
|
||||
{}
|
||||
//<-
|
||||
int get_int() const { return int_; }
|
||||
//->
|
||||
};
|
||||
|
||||
//Define an slist that will store MyClass using the public base hook
|
||||
|
@@ -42,18 +42,18 @@ struct avltree_node_cloner
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef detail::ebo_functor_holder<F> base_t;
|
||||
|
||||
avltree_node_cloner(F f)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avltree_node_cloner(F f)
|
||||
: base_t(f)
|
||||
{}
|
||||
|
||||
node_ptr operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(const node_ptr & p)
|
||||
{
|
||||
node_ptr n = base_t::get()(p);
|
||||
NodeTraits::set_balance(n, NodeTraits::get_balance(p));
|
||||
return n;
|
||||
}
|
||||
|
||||
node_ptr operator()(const node_ptr & p) const
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(const node_ptr & p) const
|
||||
{
|
||||
node_ptr n = base_t::get()(p);
|
||||
NodeTraits::set_balance(n, NodeTraits::get_balance(p));
|
||||
@@ -176,12 +176,12 @@ class avltree_algorithms
|
||||
static node_ptr end_node(const const_node_ptr & header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree
|
||||
static void swap_tree(const node_ptr & header1, const node_ptr & header2);
|
||||
static void swap_tree(node_ptr header1, node_ptr header2);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & node2)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr node2)
|
||||
{
|
||||
if(node1 == node2)
|
||||
return;
|
||||
@@ -190,8 +190,8 @@ class avltree_algorithms
|
||||
swap_nodes(node1, header1, node2, header2);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
|
||||
{
|
||||
if(node1 == node2) return;
|
||||
|
||||
@@ -202,23 +202,23 @@ class avltree_algorithms
|
||||
NodeTraits::set_balance(node2, c);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
|
||||
{
|
||||
if(node_to_be_replaced == new_node)
|
||||
return;
|
||||
replace_node(node_to_be_replaced, bstree_algo::get_header(node_to_be_replaced), new_node);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::replace_node(node_to_be_replaced, header, new_node);
|
||||
NodeTraits::set_balance(new_node, NodeTraits::get_balance(node_to_be_replaced));
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(const node_ptr&)
|
||||
static void unlink(const node_ptr & node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr)
|
||||
static void unlink(node_ptr node)
|
||||
{
|
||||
node_ptr x = NodeTraits::get_parent(node);
|
||||
if(x){
|
||||
@@ -244,7 +244,7 @@ class avltree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&)
|
||||
static node_ptr prev_node(const node_ptr & node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr)
|
||||
static void init(const node_ptr & node);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
@@ -258,14 +258,14 @@ class avltree_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
|
||||
static void init_header(const node_ptr & header)
|
||||
static void init_header(node_ptr header)
|
||||
{
|
||||
bstree_algo::init_header(header);
|
||||
NodeTraits::set_balance(header, NodeTraits::zero());
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(const node_ptr&,const node_ptr&)
|
||||
static node_ptr erase(const node_ptr & header, const node_ptr & z)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr)
|
||||
static node_ptr erase(node_ptr header, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::data_for_rebalance info;
|
||||
bstree_algo::erase(header, z, info);
|
||||
@@ -276,7 +276,7 @@ class avltree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_unique
|
||||
template<class NodePtrCompare>
|
||||
static bool transfer_unique
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::data_for_rebalance info;
|
||||
bool const transferred = bstree_algo::transfer_unique(header1, comp, header2, z, info);
|
||||
@@ -290,7 +290,7 @@ class avltree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_equal
|
||||
template<class NodePtrCompare>
|
||||
static void transfer_equal
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::data_for_rebalance info;
|
||||
bstree_algo::transfer_equal(header1, comp, header2, z, info);
|
||||
@@ -298,10 +298,10 @@ class avltree_algorithms
|
||||
rebalance_after_insertion(header1, z);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,const node_ptr&,Cloner,Disposer)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer)
|
||||
template <class Cloner, class Disposer>
|
||||
static void clone
|
||||
(const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer)
|
||||
(const const_node_ptr & source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
|
||||
{
|
||||
avltree_node_cloner<NodeTraits, Cloner> new_cloner(cloner);
|
||||
bstree_algo::clone(source_header, target_header, new_cloner, disposer);
|
||||
@@ -344,54 +344,54 @@ class avltree_algorithms
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_upper_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
bstree_algo::insert_equal_upper_bound(h, new_node, comp);
|
||||
rebalance_after_insertion(h, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_lower_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
bstree_algo::insert_equal_lower_bound(h, new_node, comp);
|
||||
rebalance_after_insertion(h, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(const node_ptr&,const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(node_ptr,node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal
|
||||
(const node_ptr & header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
bstree_algo::insert_equal(header, hint, new_node, comp);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr)
|
||||
static node_ptr insert_before
|
||||
(const node_ptr & header, const node_ptr & pos, const node_ptr & new_node)
|
||||
(node_ptr header, node_ptr pos, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::insert_before(header, pos, new_node);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(const node_ptr&,const node_ptr&)
|
||||
static void push_back(const node_ptr & header, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr)
|
||||
static void push_back(node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::push_back(header, new_node);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(const node_ptr&,const node_ptr&)
|
||||
static void push_front(const node_ptr & header, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr)
|
||||
static void push_front(node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::push_front(header, new_node);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
@@ -411,9 +411,9 @@ class avltree_algorithms
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(const node_ptr&,const node_ptr&,const insert_commit_data &)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data &)
|
||||
static void insert_unique_commit
|
||||
(const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data)
|
||||
(node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
|
||||
{
|
||||
bstree_algo::insert_unique_commit(header, new_value, commit_data);
|
||||
rebalance_after_insertion(header, new_value);
|
||||
@@ -483,7 +483,7 @@ class avltree_algorithms
|
||||
}
|
||||
|
||||
static void rebalance_after_erasure
|
||||
( const node_ptr & header, const node_ptr &z, const typename bstree_algo::data_for_rebalance &info)
|
||||
( node_ptr header, node_ptr z, const typename bstree_algo::data_for_rebalance &info)
|
||||
{
|
||||
if(info.y != z){
|
||||
NodeTraits::set_balance(info.y, NodeTraits::get_balance(z));
|
||||
@@ -492,7 +492,7 @@ class avltree_algorithms
|
||||
rebalance_after_erasure_restore_invariants(header, info.x, info.x_parent);
|
||||
}
|
||||
|
||||
static void rebalance_after_erasure_restore_invariants(const node_ptr & header, node_ptr x, node_ptr x_parent)
|
||||
static void rebalance_after_erasure_restore_invariants(node_ptr header, node_ptr x, node_ptr x_parent)
|
||||
{
|
||||
for ( node_ptr root = NodeTraits::get_parent(header)
|
||||
; x != root
|
||||
@@ -560,7 +560,7 @@ class avltree_algorithms
|
||||
}
|
||||
}
|
||||
|
||||
static void rebalance_after_insertion(const node_ptr & header, node_ptr x)
|
||||
static void rebalance_after_insertion(node_ptr header, node_ptr x)
|
||||
{
|
||||
NodeTraits::set_balance(x, NodeTraits::zero());
|
||||
// Rebalance.
|
||||
@@ -605,7 +605,7 @@ class avltree_algorithms
|
||||
}
|
||||
}
|
||||
|
||||
static void left_right_balancing(const node_ptr & a, const node_ptr & b, const node_ptr & c)
|
||||
static void left_right_balancing(node_ptr a, node_ptr b, node_ptr c)
|
||||
{
|
||||
// balancing...
|
||||
const balance c_balance = NodeTraits::get_balance(c);
|
||||
@@ -630,7 +630,7 @@ class avltree_algorithms
|
||||
}
|
||||
}
|
||||
|
||||
static node_ptr avl_rotate_left_right(const node_ptr a, const node_ptr a_oldleft, const node_ptr & hdr)
|
||||
static node_ptr avl_rotate_left_right(const node_ptr a, const node_ptr a_oldleft, node_ptr hdr)
|
||||
{ // [note: 'a_oldleft' is 'b']
|
||||
// | | //
|
||||
// a(-2) c //
|
||||
@@ -650,7 +650,7 @@ class avltree_algorithms
|
||||
return c;
|
||||
}
|
||||
|
||||
static node_ptr avl_rotate_right_left(const node_ptr a, const node_ptr a_oldright, const node_ptr & hdr)
|
||||
static node_ptr avl_rotate_right_left(const node_ptr a, const node_ptr a_oldright, node_ptr hdr)
|
||||
{ // [note: 'a_oldright' is 'b']
|
||||
// | | //
|
||||
// a(pos) c //
|
||||
@@ -670,7 +670,7 @@ class avltree_algorithms
|
||||
return c;
|
||||
}
|
||||
|
||||
static void avl_rotate_left(const node_ptr &x, const node_ptr &x_oldright, const node_ptr & hdr)
|
||||
static void avl_rotate_left(node_ptr x, node_ptr x_oldright, node_ptr hdr)
|
||||
{
|
||||
bstree_algo::rotate_left(x, x_oldright, NodeTraits::get_parent(x), hdr);
|
||||
|
||||
@@ -685,7 +685,7 @@ class avltree_algorithms
|
||||
}
|
||||
}
|
||||
|
||||
static void avl_rotate_right(const node_ptr &x, const node_ptr &x_oldleft, const node_ptr & hdr)
|
||||
static void avl_rotate_right(node_ptr x, node_ptr x_oldleft, node_ptr hdr)
|
||||
{
|
||||
bstree_algo::rotate_right(x, x_oldleft, NodeTraits::get_parent(x), hdr);
|
||||
|
||||
|
@@ -277,7 +277,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! node1 and node2 are not equivalent according to the ordering rules.
|
||||
//!
|
||||
//!Experimental function
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & node2)
|
||||
static void swap_nodes(node_ptr node1, node_ptr node2)
|
||||
{
|
||||
if(node1 == node2)
|
||||
return;
|
||||
@@ -301,7 +301,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! node1 and node2 are not equivalent according to the ordering rules.
|
||||
//!
|
||||
//!Experimental function
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2)
|
||||
static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
|
||||
{
|
||||
if(node1 == node2)
|
||||
return;
|
||||
@@ -448,7 +448,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! new_node is not equivalent to node_to_be_replaced according to the
|
||||
//! ordering rules. This function is faster than erasing and inserting
|
||||
//! the node, since no rebalancing and comparison is needed. Experimental function
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
|
||||
{
|
||||
if(node_to_be_replaced == new_node)
|
||||
return;
|
||||
@@ -469,7 +469,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! new_node is not equivalent to node_to_be_replaced according to the
|
||||
//! ordering rules. This function is faster than erasing and inserting
|
||||
//! the node, since no rebalancing or comparison is needed. Experimental function
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
|
||||
{
|
||||
if(node_to_be_replaced == new_node)
|
||||
return;
|
||||
@@ -559,7 +559,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(const node_ptr & node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr node)
|
||||
{
|
||||
NodeTraits::set_parent(node, node_ptr());
|
||||
NodeTraits::set_left(node, node_ptr());
|
||||
@@ -588,7 +588,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(const node_ptr & header)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr header)
|
||||
{
|
||||
NodeTraits::set_parent(header, node_ptr());
|
||||
NodeTraits::set_left(header, header);
|
||||
@@ -629,7 +629,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! only be used for more unlink_leftmost_without_rebalance calls.
|
||||
//! This function is normally used to achieve a step by step
|
||||
//! controlled destruction of the tree.
|
||||
static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header)
|
||||
static node_ptr unlink_leftmost_without_rebalance(node_ptr header)
|
||||
{
|
||||
node_ptr leftmost = NodeTraits::get_left(header);
|
||||
if (leftmost == header)
|
||||
@@ -684,7 +684,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void swap_tree(const node_ptr & header1, const node_ptr & header2)
|
||||
static void swap_tree(node_ptr header1, node_ptr header2)
|
||||
{
|
||||
if(header1 == header2)
|
||||
return;
|
||||
@@ -956,7 +956,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! previously executed to fill "commit_data". No value should be inserted or
|
||||
//! erased between the "insert_check" and "insert_commit" calls.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void insert_unique_commit
|
||||
(const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data)
|
||||
(node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
|
||||
{ return insert_commit(header, new_value, commit_data); }
|
||||
|
||||
//! <b>Requires</b>: "header" must be the header node of a tree.
|
||||
@@ -1112,7 +1112,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: If "comp" throws.
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal
|
||||
(const node_ptr & h, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr h, node_ptr hint, node_ptr new_node, NodePtrCompare comp
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1138,7 +1138,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: If "comp" throws.
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_upper_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1164,7 +1164,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: If "comp" throws.
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_lower_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1191,7 +1191,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
|
||||
//! tree invariants might be broken.
|
||||
static node_ptr insert_before
|
||||
(const node_ptr & header, const node_ptr & pos, const node_ptr & new_node
|
||||
(node_ptr header, node_ptr pos, node_ptr new_node
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1217,7 +1217,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! tree invariants are broken. This function is slightly faster than
|
||||
//! using "insert_before".
|
||||
static void push_back
|
||||
(const node_ptr & header, const node_ptr & new_node
|
||||
(node_ptr header, node_ptr new_node
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1242,7 +1242,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! tree invariants are broken. This function is slightly faster than
|
||||
//! using "insert_before".
|
||||
static void push_front
|
||||
(const node_ptr & header, const node_ptr & new_node
|
||||
(node_ptr header, node_ptr new_node
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1292,7 +1292,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
|
||||
template <class Cloner, class Disposer>
|
||||
static void clone
|
||||
(const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer)
|
||||
(const const_node_ptr & source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
|
||||
{
|
||||
if(!unique(target_header)){
|
||||
clear_and_dispose(target_header, disposer);
|
||||
@@ -1316,7 +1316,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Complexity</b>: Amortized constant time.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void erase(const node_ptr & header, const node_ptr & z)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void erase(node_ptr header, node_ptr z)
|
||||
{
|
||||
data_for_rebalance ignored;
|
||||
erase(header, z, ignored);
|
||||
@@ -1336,7 +1336,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: If the comparison throws.
|
||||
template<class NodePtrCompare>
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool transfer_unique
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
data_for_rebalance ignored;
|
||||
return transfer_unique(header1, comp, header2, z, ignored);
|
||||
@@ -1353,7 +1353,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: If the comparison throws.
|
||||
template<class NodePtrCompare>
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void transfer_equal
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
data_for_rebalance ignored;
|
||||
transfer_equal(header1, comp, header2, z, ignored);
|
||||
@@ -1366,7 +1366,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Complexity</b>: Average complexity is constant time.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void unlink(const node_ptr & node)
|
||||
static void unlink(node_ptr node)
|
||||
{
|
||||
node_ptr x = NodeTraits::get_parent(node);
|
||||
if(x){
|
||||
@@ -1383,7 +1383,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear.
|
||||
static void rebalance(const node_ptr & header)
|
||||
static void rebalance(node_ptr header)
|
||||
{
|
||||
node_ptr root = NodeTraits::get_parent(header);
|
||||
if(root){
|
||||
@@ -1400,7 +1400,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear.
|
||||
static node_ptr rebalance_subtree(const node_ptr & old_root)
|
||||
static node_ptr rebalance_subtree(node_ptr old_root)
|
||||
{
|
||||
//Taken from:
|
||||
//"Tree rebalancing in optimal time and space"
|
||||
@@ -1476,7 +1476,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
|
||||
template<class NodePtrCompare>
|
||||
static bool transfer_unique
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z, data_for_rebalance &info)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z, data_for_rebalance &info)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bool const transferable = insert_unique_check(header1, z, comp, commit_data).second;
|
||||
@@ -1489,7 +1489,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
|
||||
template<class NodePtrCompare>
|
||||
static void transfer_equal
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z, data_for_rebalance &info)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z, data_for_rebalance &info)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
insert_equal_upper_bound_check(header1, z, comp, commit_data);
|
||||
@@ -1497,7 +1497,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
insert_commit(header1, z, commit_data);
|
||||
}
|
||||
|
||||
static void erase(const node_ptr & header, const node_ptr & z, data_for_rebalance &info)
|
||||
static void erase(node_ptr header, node_ptr z, data_for_rebalance &info)
|
||||
{
|
||||
node_ptr y(z);
|
||||
node_ptr x;
|
||||
@@ -1643,7 +1643,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
{ return NodeTraits::get_right(NodeTraits::get_parent(p)) == p; }
|
||||
|
||||
static void insert_before_check
|
||||
(const node_ptr &header, const node_ptr & pos
|
||||
(node_ptr header, node_ptr pos
|
||||
, insert_commit_data &commit_data
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
@@ -1662,7 +1662,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
static void push_back_check
|
||||
(const node_ptr & header, insert_commit_data &commit_data
|
||||
(node_ptr header, insert_commit_data &commit_data
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1677,7 +1677,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
static void push_front_check
|
||||
(const node_ptr & header, insert_commit_data &commit_data
|
||||
(node_ptr header, insert_commit_data &commit_data
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
, std::size_t *pdepth = 0
|
||||
#endif
|
||||
@@ -1693,7 +1693,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
|
||||
template<class NodePtrCompare>
|
||||
static void insert_equal_check
|
||||
(const node_ptr &header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp
|
||||
, insert_commit_data &commit_data
|
||||
/// @cond
|
||||
, std::size_t *pdepth = 0
|
||||
@@ -1722,7 +1722,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
|
||||
template<class NodePtrCompare>
|
||||
static void insert_equal_upper_bound_check
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
|
||||
{
|
||||
std::size_t depth = 0;
|
||||
node_ptr y(h);
|
||||
@@ -1741,7 +1741,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
|
||||
template<class NodePtrCompare>
|
||||
static void insert_equal_lower_bound_check
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
|
||||
{
|
||||
std::size_t depth = 0;
|
||||
node_ptr y(h);
|
||||
@@ -1759,7 +1759,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
static void insert_commit
|
||||
(const node_ptr & header, const node_ptr & new_node, const insert_commit_data &commit_data)
|
||||
(node_ptr header, node_ptr new_node, const insert_commit_data &commit_data)
|
||||
{
|
||||
//Check if commit_data has not been initialized by a insert_unique_check call.
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(commit_data.node != node_ptr());
|
||||
@@ -1785,7 +1785,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
//Fix header and own's parent data when replacing x with own, providing own's old data with parent
|
||||
static void set_child(const node_ptr & header, const node_ptr & new_child, const node_ptr & new_parent, const bool link_left)
|
||||
static void set_child(node_ptr header, node_ptr new_child, node_ptr new_parent, const bool link_left)
|
||||
{
|
||||
if(new_parent == header)
|
||||
NodeTraits::set_parent(header, new_child);
|
||||
@@ -1796,7 +1796,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
// rotate p to left (no header and p's parent fixup)
|
||||
static void rotate_left_no_parent_fix(const node_ptr & p, const node_ptr &p_right)
|
||||
static void rotate_left_no_parent_fix(node_ptr p, node_ptr p_right)
|
||||
{
|
||||
node_ptr p_right_left(NodeTraits::get_left(p_right));
|
||||
NodeTraits::set_right(p, p_right_left);
|
||||
@@ -1808,7 +1808,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
// rotate p to left (with header and p's parent fixup)
|
||||
static void rotate_left(const node_ptr & p, const node_ptr & p_right, const node_ptr & p_parent, const node_ptr & header)
|
||||
static void rotate_left(node_ptr p, node_ptr p_right, node_ptr p_parent, node_ptr header)
|
||||
{
|
||||
const bool p_was_left(NodeTraits::get_left(p_parent) == p);
|
||||
rotate_left_no_parent_fix(p, p_right);
|
||||
@@ -1817,7 +1817,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
// rotate p to right (no header and p's parent fixup)
|
||||
static void rotate_right_no_parent_fix(const node_ptr & p, const node_ptr &p_left)
|
||||
static void rotate_right_no_parent_fix(node_ptr p, node_ptr p_left)
|
||||
{
|
||||
node_ptr p_left_right(NodeTraits::get_right(p_left));
|
||||
NodeTraits::set_left(p, p_left_right);
|
||||
@@ -1829,7 +1829,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
|
||||
// rotate p to right (with header and p's parent fixup)
|
||||
static void rotate_right(const node_ptr & p, const node_ptr & p_left, const node_ptr & p_parent, const node_ptr & header)
|
||||
static void rotate_right(node_ptr p, node_ptr p_left, node_ptr p_parent, node_ptr header)
|
||||
{
|
||||
const bool p_was_left(NodeTraits::get_left(p_parent) == p);
|
||||
rotate_right_no_parent_fix(p, p_left);
|
||||
@@ -1883,7 +1883,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
}
|
||||
}
|
||||
|
||||
static void vine_to_subtree(const node_ptr & super_root, std::size_t count)
|
||||
static void vine_to_subtree(node_ptr super_root, std::size_t count)
|
||||
{
|
||||
const std::size_t one_szt = 1u;
|
||||
std::size_t leaf_nodes = count + one_szt - std::size_t(one_szt << detail::floor_log2(count + one_szt));
|
||||
@@ -1927,7 +1927,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
static node_ptr clone_subtree
|
||||
(const const_node_ptr &source_parent, const node_ptr &target_parent
|
||||
(const const_node_ptr &source_parent, node_ptr target_parent
|
||||
, Cloner cloner, Disposer disposer
|
||||
, node_ptr &leftmost_out, node_ptr &rightmost_out
|
||||
)
|
||||
|
@@ -67,7 +67,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(const node_ptr &this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node)
|
||||
{
|
||||
const node_ptr null_node = node_ptr();
|
||||
NodeTraits::set_next(this_node, null_node);
|
||||
@@ -91,7 +91,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(const node_ptr &this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node)
|
||||
{
|
||||
NodeTraits::set_next(this_node, this_node);
|
||||
NodeTraits::set_previous(this_node, this_node);
|
||||
@@ -138,7 +138,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr unlink(const node_ptr &this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr unlink(node_ptr this_node)
|
||||
{
|
||||
node_ptr next(NodeTraits::get_next(this_node));
|
||||
node_ptr prev(NodeTraits::get_previous(this_node));
|
||||
@@ -154,7 +154,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink(const node_ptr &b, const node_ptr &e)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr b, node_ptr e)
|
||||
{
|
||||
if (b != e) {
|
||||
node_ptr prevb(NodeTraits::get_previous(b));
|
||||
@@ -170,7 +170,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_before(const node_ptr &nxt_node, const node_ptr &this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_before(node_ptr nxt_node, node_ptr this_node)
|
||||
{
|
||||
node_ptr prev(NodeTraits::get_previous(nxt_node));
|
||||
NodeTraits::set_previous(this_node, prev);
|
||||
@@ -189,7 +189,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_after(const node_ptr &prev_node, const node_ptr &this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node)
|
||||
{
|
||||
node_ptr next(NodeTraits::get_next(prev_node));
|
||||
NodeTraits::set_previous(this_node, prev_node);
|
||||
@@ -211,7 +211,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void swap_nodes(const node_ptr &this_node, const node_ptr &other_node)
|
||||
static void swap_nodes(node_ptr this_node, node_ptr other_node)
|
||||
{
|
||||
if (other_node == this_node)
|
||||
return;
|
||||
@@ -252,7 +252,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void transfer(const node_ptr &p, const node_ptr &b, const node_ptr &e)
|
||||
static void transfer(node_ptr p, node_ptr b, node_ptr e)
|
||||
{
|
||||
if (b != e) {
|
||||
node_ptr prev_p(NodeTraits::get_previous(p));
|
||||
@@ -277,7 +277,7 @@ class circular_list_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void transfer(const node_ptr &p, const node_ptr &i)
|
||||
static void transfer(node_ptr p, node_ptr i)
|
||||
{
|
||||
node_ptr n(NodeTraits::get_next(i));
|
||||
if(n != p && i != p){
|
||||
@@ -298,7 +298,7 @@ class circular_list_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: This function is linear time.
|
||||
static void reverse(const node_ptr &p)
|
||||
static void reverse(node_ptr p)
|
||||
{
|
||||
node_ptr f(NodeTraits::get_next(p));
|
||||
node_ptr i(NodeTraits::get_next(f)), e(p);
|
||||
@@ -316,7 +316,7 @@ class circular_list_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of moved positions.
|
||||
static void move_backwards(const node_ptr &p, std::size_t n)
|
||||
static void move_backwards(node_ptr p, std::size_t n)
|
||||
{
|
||||
//Null shift, nothing to do
|
||||
if(!n) return;
|
||||
@@ -336,7 +336,7 @@ class circular_list_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of moved positions.
|
||||
static void move_forward(const node_ptr &p, std::size_t n)
|
||||
static void move_forward(node_ptr p, std::size_t n)
|
||||
{
|
||||
//Null shift, nothing to do
|
||||
if(!n) return;
|
||||
@@ -378,7 +378,7 @@ class circular_list_algorithms
|
||||
};
|
||||
|
||||
template<class Pred>
|
||||
static void stable_partition(node_ptr beg, const node_ptr &end, Pred pred, stable_partition_info &info)
|
||||
static void stable_partition(node_ptr beg, node_ptr end, Pred pred, stable_partition_info &info)
|
||||
{
|
||||
node_ptr bcur = node_traits::get_previous(beg);
|
||||
node_ptr cur = beg;
|
||||
@@ -435,14 +435,14 @@ class circular_list_algorithms
|
||||
}
|
||||
|
||||
private:
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void swap_prev(const node_ptr &this_node, const node_ptr &other_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void swap_prev(node_ptr this_node, node_ptr other_node)
|
||||
{
|
||||
node_ptr temp(NodeTraits::get_previous(this_node));
|
||||
NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node));
|
||||
NodeTraits::set_previous(other_node, temp);
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void swap_next(const node_ptr &this_node, const node_ptr &other_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void swap_next(node_ptr this_node, node_ptr other_node)
|
||||
{
|
||||
node_ptr temp(NodeTraits::get_next(this_node));
|
||||
NodeTraits::set_next(this_node, NodeTraits::get_next(other_node));
|
||||
|
@@ -141,7 +141,7 @@ class circular_slist_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(const node_ptr &this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(node_ptr this_node)
|
||||
{ NodeTraits::set_next(this_node, this_node); }
|
||||
|
||||
//! <b>Requires</b>: this_node and prev_init_node must be in the same circular list.
|
||||
@@ -223,7 +223,7 @@ class circular_slist_algorithms
|
||||
//! <b>Complexity</b>: Linear to the number of elements in the circular list
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink(const node_ptr & this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink(node_ptr this_node)
|
||||
{
|
||||
if(NodeTraits::get_next(this_node))
|
||||
base_t::unlink_after(get_previous_node(this_node));
|
||||
@@ -236,7 +236,7 @@ class circular_slist_algorithms
|
||||
//! <b>Complexity</b>: Linear to the number of elements in the circular list.
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_before (const node_ptr & nxt_node, const node_ptr & this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_before (node_ptr nxt_node, node_ptr this_node)
|
||||
{ base_t::link_after(get_previous_node(nxt_node), this_node); }
|
||||
|
||||
//! <b>Requires</b>: this_node and other_node must be nodes inserted
|
||||
@@ -249,7 +249,7 @@ class circular_slist_algorithms
|
||||
//! <b>Complexity</b>: Linear to number of elements of both lists
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void swap_nodes(const node_ptr & this_node, const node_ptr & other_node)
|
||||
static void swap_nodes(node_ptr this_node, node_ptr other_node)
|
||||
{
|
||||
if (other_node == this_node)
|
||||
return;
|
||||
@@ -275,7 +275,7 @@ class circular_slist_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: This function is linear to the contained elements.
|
||||
static void reverse(const node_ptr & p)
|
||||
static void reverse(node_ptr p)
|
||||
{
|
||||
node_ptr i = NodeTraits::get_next(p), e(p);
|
||||
for (;;) {
|
||||
@@ -294,7 +294,7 @@ class circular_slist_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
|
||||
static node_ptr move_backwards(const node_ptr & p, std::size_t n)
|
||||
static node_ptr move_backwards(node_ptr p, std::size_t n)
|
||||
{
|
||||
//Null shift, nothing to do
|
||||
if(!n) return node_ptr();
|
||||
@@ -346,7 +346,7 @@ class circular_slist_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
|
||||
static node_ptr move_forward(const node_ptr & p, std::size_t n)
|
||||
static node_ptr move_forward(node_ptr p, std::size_t n)
|
||||
{
|
||||
//Null shift, nothing to do
|
||||
if(!n) return node_ptr();
|
||||
|
@@ -65,7 +65,7 @@ struct derivation_value_traits
|
||||
|
||||
static const_pointer to_value_ptr(const const_node_ptr &n)
|
||||
{
|
||||
return pointer_traits<pointer>::pointer_to(static_cast<const_reference>(*n));
|
||||
return pointer_traits<const_pointer>::pointer_to(static_cast<const_reference>(*n));
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -52,13 +52,13 @@ struct any_list_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->node_ptr_1 = next; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const const_node_ptr & n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_previous(const node_ptr & n, const node_ptr & prev)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_previous(node_ptr n, node_ptr prev)
|
||||
{ n->node_ptr_2 = prev; }
|
||||
};
|
||||
|
||||
@@ -73,7 +73,7 @@ struct any_slist_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->node_ptr_1 = next; }
|
||||
};
|
||||
|
||||
@@ -93,13 +93,13 @@ struct any_unordered_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->node_ptr_1 = next; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_prev_in_group(const const_node_ptr & n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_prev_in_group(const node_ptr & n, const node_ptr & prev)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_prev_in_group(node_ptr n, node_ptr prev)
|
||||
{ n->node_ptr_2 = prev; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const const_node_ptr & n)
|
||||
@@ -122,19 +122,19 @@ struct any_rbtree_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->node_ptr_1 = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->node_ptr_2 = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
{ return n->node_ptr_3; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->node_ptr_3 = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
|
||||
@@ -163,19 +163,19 @@ struct any_avltree_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->node_ptr_1 = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->node_ptr_2 = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
{ return n->node_ptr_3; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->node_ptr_3 = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
|
||||
@@ -205,19 +205,19 @@ struct any_tree_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return n->node_ptr_1; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->node_ptr_1 = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
{ return n->node_ptr_2; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->node_ptr_2 = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
{ return n->node_ptr_3; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->node_ptr_3 = r; }
|
||||
};
|
||||
|
||||
|
@@ -63,7 +63,7 @@ struct avltree_node
|
||||
template<class VoidPointer>
|
||||
struct default_avltree_node_traits_impl
|
||||
{
|
||||
typedef avltree_node<VoidPointer> node;
|
||||
typedef avltree_node<VoidPointer> node;
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
|
||||
@@ -75,7 +75,7 @@ struct default_avltree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
@@ -84,7 +84,7 @@ struct default_avltree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
@@ -93,7 +93,7 @@ struct default_avltree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
|
||||
@@ -121,8 +121,8 @@ template<class VoidPointer>
|
||||
struct compact_avltree_node_traits_impl
|
||||
{
|
||||
typedef compact_avltree_node<VoidPointer> node;
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
typedef typename node::node_ptr node_ptr;
|
||||
typedef typename node::const_node_ptr const_node_ptr;
|
||||
typedef typename node::balance balance;
|
||||
|
||||
typedef pointer_plus_bits<node_ptr, 2> ptr_bit;
|
||||
@@ -130,19 +130,19 @@ struct compact_avltree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return ptr_bit::get_pointer(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ ptr_bit::set_pointer(n->parent_, p); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
|
||||
|
@@ -52,7 +52,7 @@ class common_slist_algorithms
|
||||
return p;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(const node_ptr & this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(node_ptr this_node)
|
||||
{ NodeTraits::set_next(this_node, node_ptr()); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & this_node)
|
||||
@@ -64,29 +64,29 @@ class common_slist_algorithms
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & this_node)
|
||||
{ return !NodeTraits::get_next(this_node); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(const node_ptr & prev_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node)
|
||||
{
|
||||
const_node_ptr this_node(NodeTraits::get_next(prev_node));
|
||||
NodeTraits::set_next(prev_node, NodeTraits::get_next(this_node));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(const node_ptr & prev_node, const node_ptr & last_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink_after(node_ptr prev_node, node_ptr last_node)
|
||||
{ NodeTraits::set_next(prev_node, last_node); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_after(const node_ptr & prev_node, const node_ptr & this_node)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void link_after(node_ptr prev_node, node_ptr this_node)
|
||||
{
|
||||
NodeTraits::set_next(this_node, NodeTraits::get_next(prev_node));
|
||||
NodeTraits::set_next(prev_node, this_node);
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void incorporate_after(const node_ptr & bp, const node_ptr & b, const node_ptr & be)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void incorporate_after(node_ptr bp, node_ptr b, node_ptr be)
|
||||
{
|
||||
node_ptr p(NodeTraits::get_next(bp));
|
||||
NodeTraits::set_next(bp, b);
|
||||
NodeTraits::set_next(be, p);
|
||||
}
|
||||
|
||||
static void transfer_after(const node_ptr & bp, const node_ptr & bb, const node_ptr & be)
|
||||
static void transfer_after(node_ptr bp, node_ptr bb, node_ptr be)
|
||||
{
|
||||
if (bp != bb && bp != be && bb != be) {
|
||||
node_ptr next_b = NodeTraits::get_next(bb);
|
||||
@@ -107,7 +107,7 @@ class common_slist_algorithms
|
||||
};
|
||||
|
||||
template<class Pred>
|
||||
static void stable_partition(node_ptr before_beg, const node_ptr &end, Pred pred, stable_partition_info &info)
|
||||
static void stable_partition(node_ptr before_beg, node_ptr end, Pred pred, stable_partition_info &info)
|
||||
{
|
||||
node_ptr bcur = before_beg;
|
||||
node_ptr cur = node_traits::get_next(bcur);
|
||||
|
@@ -66,7 +66,7 @@ class list_iterator
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
|
||||
|
@@ -53,7 +53,7 @@ struct list_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const node_ptr & n)
|
||||
{ return n->prev_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_previous(const node_ptr & n, const node_ptr & prev)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_previous(node_ptr n, node_ptr prev)
|
||||
{ n->prev_ = prev; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
|
||||
@@ -62,7 +62,7 @@ struct list_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
|
||||
{ return n->next_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->next_ = next; }
|
||||
};
|
||||
|
||||
|
@@ -59,7 +59,7 @@ struct node_cloner
|
||||
{}
|
||||
|
||||
// tree-based containers use this method, which is proxy-reference friendly
|
||||
node_ptr operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(const node_ptr & p)
|
||||
{
|
||||
reference_type v = *traits_->to_value_ptr(p);
|
||||
node_ptr n = traits_->to_node_ptr(*base_t::get()(v));
|
||||
@@ -89,7 +89,7 @@ struct node_disposer
|
||||
: base_t(f), traits_(cont)
|
||||
{}
|
||||
|
||||
void operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p)
|
||||
{
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(p);
|
||||
|
@@ -80,7 +80,7 @@ struct default_rbtree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
@@ -89,7 +89,7 @@ struct default_rbtree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
@@ -98,7 +98,7 @@ struct default_rbtree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
|
||||
@@ -136,7 +136,7 @@ struct compact_rbtree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
{ return ptr_bit::get_pointer(n->parent_); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ ptr_bit::set_pointer(n->parent_, p); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
@@ -145,7 +145,7 @@ struct compact_rbtree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
@@ -154,7 +154,7 @@ struct compact_rbtree_node_traits_impl
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
|
||||
|
@@ -39,7 +39,7 @@ class init_disposer
|
||||
typedef typename NodeAlgorithms::node_ptr node_ptr;
|
||||
|
||||
public:
|
||||
void operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p)
|
||||
{ NodeAlgorithms::init(p); }
|
||||
};
|
||||
|
||||
|
@@ -68,7 +68,7 @@ class slist_iterator
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const node_ptr &node)
|
||||
|
@@ -52,7 +52,7 @@ struct slist_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
|
||||
{ return n->next_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->next_ = next; }
|
||||
};
|
||||
|
||||
|
@@ -74,7 +74,7 @@ class tree_iterator
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const node_ptr &nodeptr)
|
||||
|
@@ -50,7 +50,7 @@ struct tree_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
|
||||
{ return n->parent_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_parent(node_ptr n, node_ptr p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
|
||||
@@ -59,7 +59,7 @@ struct tree_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
|
||||
{ return n->left_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_left(node_ptr n, node_ptr l)
|
||||
{ n->left_ = l; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
|
||||
@@ -68,7 +68,7 @@ struct tree_node_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
|
||||
{ return n->right_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_right(node_ptr n, node_ptr r)
|
||||
{ n->right_ = r; }
|
||||
};
|
||||
|
||||
|
@@ -45,7 +45,7 @@ struct disable_if_smartref_to
|
||||
|
||||
//This function object takes a KeyCompare function object
|
||||
//and compares values that contains keys using KeyOfValue
|
||||
template< class ValuePtr, class KeyCompare, class KeyOfValue
|
||||
template< class ValuePtr, class KeyCompare, class KeyOfValue, class Ret = bool
|
||||
, bool = boost::intrusive::detail::is_same
|
||||
<typename boost::movelib::pointer_element<ValuePtr>::type, typename KeyOfValue::type>::value >
|
||||
struct tree_value_compare
|
||||
@@ -80,41 +80,52 @@ struct tree_value_compare
|
||||
BOOST_INTRUSIVE_FORCEINLINE const key_compare &key_comp() const
|
||||
{ return static_cast<const key_compare &>(*this); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key) const
|
||||
{ return this->key_comp()(key); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const value_type &value) const
|
||||
{ return this->key_comp()(KeyOfValue()(value)); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(nonkey); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
|
||||
{ return this->key_comp()(key1, key2); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const value_type &value1, const value_type &value2) const
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const value_type &value1, const value_type &value2) const
|
||||
{ return this->key_comp()(KeyOfValue()(value1), KeyOfValue()(value2)); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const value_type &value2) const
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const value_type &value2) const
|
||||
{ return this->key_comp()(key1, KeyOfValue()(value2)); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const value_type &value1, const key_type &key2) const
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const value_type &value1, const key_type &key2) const
|
||||
{ return this->key_comp()(KeyOfValue()(value1), key2); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()( const key_type &key1, const U &nonkey2
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(key1, nonkey2); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()( const U &nonkey1, const key_type &key2
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey1, const key_type &key2
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(nonkey1, key2); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()( const value_type &value1, const U &nonvalue2
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const value_type &value1, const U &nonvalue2
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(KeyOfValue()(value1), nonvalue2); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()( const U &nonvalue1, const value_type &value2
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonvalue1, const value_type &value2
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(nonvalue1, KeyOfValue()(value2)); }
|
||||
};
|
||||
|
||||
template<class ValuePtr, class KeyCompare, class KeyOfValue>
|
||||
struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, true>
|
||||
template<class ValuePtr, class KeyCompare, class KeyOfValue, class Ret>
|
||||
struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, Ret, true>
|
||||
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
|
||||
{
|
||||
typedef typename
|
||||
@@ -147,16 +158,24 @@ struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, true>
|
||||
BOOST_INTRUSIVE_FORCEINLINE const key_compare &key_comp() const
|
||||
{ return static_cast<const key_compare &>(*this); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key) const
|
||||
{ return this->key_comp()(key); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(nonkey); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
|
||||
{ return this->key_comp()(key1, key2); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()( const key_type &key1, const U &nonkey2
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(key1, nonkey2); }
|
||||
|
||||
template<class U>
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &nonkey1, const key_type &key2
|
||||
BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const U &nonkey1, const key_type &key2
|
||||
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
|
||||
{ return this->key_comp()(nonkey1, key2); }
|
||||
};
|
||||
|
@@ -375,7 +375,7 @@ struct group_functions
|
||||
typedef circular_slist_algorithms<node_traits> node_algorithms;
|
||||
|
||||
static slist_node_ptr get_bucket_before_begin
|
||||
(const slist_node_ptr &bucket_beg, const slist_node_ptr &bucket_end, const node_ptr &p)
|
||||
(slist_node_ptr bucket_beg, slist_node_ptr bucket_end, node_ptr p)
|
||||
{
|
||||
//First find the last node of p's group.
|
||||
//This requires checking the first node of the next group or
|
||||
@@ -406,7 +406,7 @@ struct group_functions
|
||||
return possible_end;
|
||||
}
|
||||
|
||||
static node_ptr get_prev_to_first_in_group(const slist_node_ptr &bucket_node, const node_ptr &first_in_group)
|
||||
static node_ptr get_prev_to_first_in_group(slist_node_ptr bucket_node, node_ptr first_in_group)
|
||||
{
|
||||
node_ptr nb = detail::dcast_bucket_ptr<node>(bucket_node);
|
||||
node_ptr n;
|
||||
@@ -416,7 +416,7 @@ struct group_functions
|
||||
return nb;
|
||||
}
|
||||
|
||||
static void erase_from_group(const slist_node_ptr &end_ptr, const node_ptr &to_erase_ptr, detail::true_)
|
||||
static void erase_from_group(slist_node_ptr end_ptr, node_ptr to_erase_ptr, detail::true_)
|
||||
{
|
||||
node_ptr const nxt_ptr(node_traits::get_next(to_erase_ptr));
|
||||
//Check if the next node is in the group (not end node) and reverse linked to
|
||||
@@ -429,7 +429,7 @@ struct group_functions
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void erase_from_group(const slist_node_ptr&, const node_ptr&, detail::false_)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_last_in_group(const node_ptr &first_in_group, detail::true_)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_last_in_group(node_ptr first_in_group, detail::true_)
|
||||
{ return group_traits::get_next(first_in_group); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_last_in_group(node_ptr n, detail::false_)
|
||||
@@ -449,10 +449,10 @@ struct group_functions
|
||||
return node_traits::get_next(group_traits::get_next(ptr));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_first_in_group(const node_ptr &n, detail::false_)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_first_in_group(node_ptr n, detail::false_)
|
||||
{ return n; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void insert_in_group(const node_ptr &first_in_group, const node_ptr &n, true_)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void insert_in_group(node_ptr first_in_group, node_ptr n, true_)
|
||||
{ group_algorithms::link_after(first_in_group, n); }
|
||||
|
||||
static void insert_in_group(const node_ptr&, const node_ptr&, false_)
|
||||
@@ -672,8 +672,8 @@ struct bucket_plus_vtraits
|
||||
typedef detail::bucket_impl<slist_impl> bucket_type;
|
||||
typedef detail::group_functions<node_traits> group_functions_t;
|
||||
typedef typename slist_impl::node_algorithms node_algorithms;
|
||||
typedef typename slist_impl::node_ptr slist_node_ptr;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename slist_impl::node_ptr slist_node_ptr;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename value_traits::value_type value_type;
|
||||
typedef typename value_traits::pointer pointer;
|
||||
@@ -1383,15 +1383,15 @@ struct hashdata_internal
|
||||
<const_pointer>::reference const_reference;
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||
typedef detail::node_functions<node_traits> node_functions_t;
|
||||
typedef typename detail::get_slist_impl
|
||||
<typename detail::reduced_slist_node_traits
|
||||
<typename value_traits::node_traits>::type
|
||||
>::type slist_impl;
|
||||
typedef typename slist_impl::node_algorithms node_algorithms;
|
||||
typedef typename slist_impl::node_ptr slist_node_ptr;
|
||||
typedef typename slist_impl::node_ptr slist_node_ptr;
|
||||
|
||||
typedef hash_key_types_base
|
||||
< typename ValueTraits::value_type
|
||||
@@ -1740,7 +1740,7 @@ class hashtable_impl
|
||||
//See documentation for more explanations
|
||||
BOOST_STATIC_ASSERT((!compare_hash || store_hash));
|
||||
|
||||
typedef typename slist_impl::node_ptr slist_node_ptr;
|
||||
typedef typename slist_impl::node_ptr slist_node_ptr;
|
||||
typedef typename pointer_traits
|
||||
<slist_node_ptr>::template rebind_pointer
|
||||
< void >::type void_pointer;
|
||||
|
@@ -184,7 +184,7 @@ class linear_slist_algorithms
|
||||
//! <b>Complexity</b>: Constant
|
||||
//!
|
||||
//! <b>Throws</b>: Nothing.
|
||||
static void swap_trailing_nodes(const node_ptr & this_node, const node_ptr & other_node)
|
||||
static void swap_trailing_nodes(node_ptr this_node, node_ptr other_node)
|
||||
{
|
||||
node_ptr this_nxt = NodeTraits::get_next(this_node);
|
||||
node_ptr other_nxt = NodeTraits::get_next(other_node);
|
||||
@@ -199,7 +199,7 @@ class linear_slist_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: This function is linear to the contained elements.
|
||||
static node_ptr reverse(const node_ptr & p)
|
||||
static node_ptr reverse(node_ptr p)
|
||||
{
|
||||
if(!p) return node_ptr();
|
||||
node_ptr i = NodeTraits::get_next(p);
|
||||
@@ -222,7 +222,7 @@ class linear_slist_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
|
||||
static std::pair<node_ptr, node_ptr> move_first_n_backwards(const node_ptr & p, std::size_t n)
|
||||
static std::pair<node_ptr, node_ptr> move_first_n_backwards(node_ptr p, std::size_t n)
|
||||
{
|
||||
std::pair<node_ptr, node_ptr> ret;
|
||||
//Null shift, or count() == 0 or 1, nothing to do
|
||||
@@ -277,7 +277,7 @@ class linear_slist_algorithms
|
||||
//! <b>Throws</b>: Nothing.
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
|
||||
static std::pair<node_ptr, node_ptr> move_first_n_forward(const node_ptr & p, std::size_t n)
|
||||
static std::pair<node_ptr, node_ptr> move_first_n_forward(node_ptr p, std::size_t n)
|
||||
{
|
||||
std::pair<node_ptr, node_ptr> ret;
|
||||
//Null shift, or count() == 0 or 1, nothing to do
|
||||
|
@@ -54,7 +54,7 @@ struct rbtree_node_cloner
|
||||
: base_t(f)
|
||||
{}
|
||||
|
||||
node_ptr operator()(const node_ptr & p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr operator()(node_ptr p)
|
||||
{
|
||||
node_ptr n = base_t::get()(p);
|
||||
NodeTraits::set_color(n, NodeTraits::get_color(p));
|
||||
@@ -200,12 +200,12 @@ class rbtree_algorithms
|
||||
static node_ptr end_node(const const_node_ptr & header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree
|
||||
static void swap_tree(const node_ptr & header1, const node_ptr & header2);
|
||||
static void swap_tree(node_ptr header1, node_ptr header2);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & node2)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr node2)
|
||||
{
|
||||
if(node1 == node2)
|
||||
return;
|
||||
@@ -214,8 +214,8 @@ class rbtree_algorithms
|
||||
swap_nodes(node1, header1, node2, header2);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
|
||||
{
|
||||
if(node1 == node2) return;
|
||||
|
||||
@@ -226,22 +226,22 @@ class rbtree_algorithms
|
||||
NodeTraits::set_color(node2, c);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
|
||||
{
|
||||
if(node_to_be_replaced == new_node)
|
||||
return;
|
||||
replace_node(node_to_be_replaced, bstree_algo::get_header(node_to_be_replaced), new_node);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::replace_node(node_to_be_replaced, header, new_node);
|
||||
NodeTraits::set_color(new_node, NodeTraits::get_color(node_to_be_replaced));
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr)
|
||||
static void unlink(const node_ptr& node)
|
||||
{
|
||||
node_ptr x = NodeTraits::get_parent(node);
|
||||
@@ -268,19 +268,19 @@ class rbtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&)
|
||||
static node_ptr prev_node(const node_ptr & node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr)
|
||||
static void init(const node_ptr & node);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(const node_ptr&)
|
||||
static void init_header(const node_ptr & header)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr)
|
||||
static void init_header(node_ptr header)
|
||||
{
|
||||
bstree_algo::init_header(header);
|
||||
NodeTraits::set_color(header, NodeTraits::red());
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(const node_ptr&,const node_ptr&)
|
||||
static node_ptr erase(const node_ptr & header, const node_ptr & z)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr)
|
||||
static node_ptr erase(node_ptr header, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::data_for_rebalance info;
|
||||
bstree_algo::erase(header, z, info);
|
||||
@@ -291,7 +291,7 @@ class rbtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_unique
|
||||
template<class NodePtrCompare>
|
||||
static bool transfer_unique
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::data_for_rebalance info;
|
||||
bool const transferred = bstree_algo::transfer_unique(header1, comp, header2, z, info);
|
||||
@@ -305,7 +305,7 @@ class rbtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_equal
|
||||
template<class NodePtrCompare>
|
||||
static void transfer_equal
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::data_for_rebalance info;
|
||||
bstree_algo::transfer_equal(header1, comp, header2, z, info);
|
||||
@@ -313,10 +313,10 @@ class rbtree_algorithms
|
||||
rebalance_after_insertion(header1, z);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,const node_ptr&,Cloner,Disposer)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer)
|
||||
template <class Cloner, class Disposer>
|
||||
static void clone
|
||||
(const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer)
|
||||
(const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
|
||||
{
|
||||
rbtree_node_cloner<NodeTraits, Cloner> new_cloner(cloner);
|
||||
bstree_algo::clone(source_header, target_header, new_cloner, disposer);
|
||||
@@ -359,54 +359,54 @@ class rbtree_algorithms
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_upper_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
bstree_algo::insert_equal_upper_bound(h, new_node, comp);
|
||||
rebalance_after_insertion(h, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_lower_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
bstree_algo::insert_equal_lower_bound(h, new_node, comp);
|
||||
rebalance_after_insertion(h, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(const node_ptr&,const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(node_ptr,node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal
|
||||
(const node_ptr & header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
bstree_algo::insert_equal(header, hint, new_node, comp);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr)
|
||||
static node_ptr insert_before
|
||||
(const node_ptr & header, const node_ptr & pos, const node_ptr & new_node)
|
||||
(node_ptr header, node_ptr pos, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::insert_before(header, pos, new_node);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(const node_ptr&,const node_ptr&)
|
||||
static void push_back(const node_ptr & header, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr)
|
||||
static void push_back(node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::push_back(header, new_node);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(const node_ptr&,const node_ptr&)
|
||||
static void push_front(const node_ptr & header, const node_ptr & new_node)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr)
|
||||
static void push_front(node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::push_front(header, new_node);
|
||||
rebalance_after_insertion(header, new_node);
|
||||
@@ -416,19 +416,19 @@ class rbtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const KeyType &key
|
||||
(const_node_ptr header, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const node_ptr &hint, const KeyType &key
|
||||
(const_node_ptr header, node_ptr hint, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(const node_ptr&,const node_ptr&,const insert_commit_data&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data&)
|
||||
static void insert_unique_commit
|
||||
(const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data)
|
||||
(node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
|
||||
{
|
||||
bstree_algo::insert_unique_commit(header, new_value, commit_data);
|
||||
rebalance_after_insertion(header, new_value);
|
||||
@@ -445,7 +445,7 @@ class rbtree_algorithms
|
||||
private:
|
||||
|
||||
static void rebalance_after_erasure
|
||||
( const node_ptr & header, const node_ptr &z, const typename bstree_algo::data_for_rebalance &info)
|
||||
( node_ptr header, node_ptr z, const typename bstree_algo::data_for_rebalance &info)
|
||||
{
|
||||
color new_z_color;
|
||||
if(info.y != z){
|
||||
@@ -461,7 +461,7 @@ class rbtree_algorithms
|
||||
}
|
||||
}
|
||||
|
||||
static void rebalance_after_erasure_restore_invariants(const node_ptr & header, node_ptr x, node_ptr x_parent)
|
||||
static void rebalance_after_erasure_restore_invariants(node_ptr header, node_ptr x, node_ptr x_parent)
|
||||
{
|
||||
while(1){
|
||||
if(x_parent == header || (x && NodeTraits::get_color(x) != NodeTraits::black())){
|
||||
@@ -545,7 +545,7 @@ class rbtree_algorithms
|
||||
NodeTraits::set_color(x, NodeTraits::black());
|
||||
}
|
||||
|
||||
static void rebalance_after_insertion(const node_ptr & header, node_ptr p)
|
||||
static void rebalance_after_insertion(node_ptr header, node_ptr p)
|
||||
{
|
||||
NodeTraits::set_color(p, NodeTraits::red());
|
||||
while(1){
|
||||
|
@@ -65,8 +65,8 @@ class sgtree_algorithms
|
||||
public:
|
||||
typedef typename NodeTraits::node node;
|
||||
typedef NodeTraits node_traits;
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
|
||||
/// @cond
|
||||
private:
|
||||
@@ -86,57 +86,57 @@ class sgtree_algorithms
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&)
|
||||
static node_ptr get_header(const const_node_ptr & n);
|
||||
static node_ptr get_header(const_node_ptr n);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::begin_node
|
||||
static node_ptr begin_node(const const_node_ptr & header);
|
||||
static node_ptr begin_node(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::end_node
|
||||
static node_ptr end_node(const const_node_ptr & header);
|
||||
static node_ptr end_node(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree
|
||||
static void swap_tree(const node_ptr & header1, const node_ptr & header2);
|
||||
static void swap_tree(node_ptr header1, node_ptr header2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & node2);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr node2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node);
|
||||
|
||||
//Unlink is not possible since tree metadata is needed to update the tree
|
||||
//!static void unlink(const node_ptr & node);
|
||||
//!static void unlink(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance
|
||||
static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header);
|
||||
static node_ptr unlink_leftmost_without_rebalance(node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&)
|
||||
static bool unique(const const_node_ptr & node);
|
||||
static bool unique(const_node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&)
|
||||
static std::size_t size(const const_node_ptr & header);
|
||||
static std::size_t size(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&)
|
||||
static node_ptr next_node(const node_ptr & node);
|
||||
static node_ptr next_node(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&)
|
||||
static node_ptr prev_node(const node_ptr & node);
|
||||
static node_ptr prev_node(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(const node_ptr&)
|
||||
static void init(const node_ptr & node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr)
|
||||
static void init(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(const node_ptr&)
|
||||
static void init_header(const node_ptr & header);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr)
|
||||
static void init_header(node_ptr header);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr)
|
||||
template<class AlphaByMaxSize>
|
||||
static node_ptr erase(const node_ptr & header, const node_ptr & z, std::size_t tree_size, std::size_t &max_tree_size, AlphaByMaxSize alpha_by_maxsize)
|
||||
static node_ptr erase(node_ptr header, node_ptr z, std::size_t tree_size, std::size_t &max_tree_size, AlphaByMaxSize alpha_by_maxsize)
|
||||
{
|
||||
bstree_algo::erase(header, z);
|
||||
--tree_size;
|
||||
@@ -149,51 +149,51 @@ class sgtree_algorithms
|
||||
}
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,const node_ptr&,Cloner,Disposer)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer)
|
||||
template <class Cloner, class Disposer>
|
||||
static void clone
|
||||
(const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer);
|
||||
(const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer)
|
||||
template<class Disposer>
|
||||
static void clear_and_dispose(const node_ptr & header, Disposer disposer);
|
||||
static void clear_and_dispose(node_ptr header, Disposer disposer);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr lower_bound
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr upper_bound
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr find
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> equal_range
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> bounded_range
|
||||
(const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
(const_node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
, bool left_closed, bool right_closed);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::size_t count(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
static std::size_t count(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare, class H_Alpha>
|
||||
static node_ptr insert_equal_upper_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -202,10 +202,10 @@ class sgtree_algorithms
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare, class H_Alpha>
|
||||
static node_ptr insert_equal_lower_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -214,10 +214,10 @@ class sgtree_algorithms
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(const node_ptr&,const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(node_ptr,node_ptr,node_ptr,NodePtrCompare)
|
||||
template<class NodePtrCompare, class H_Alpha>
|
||||
static node_ptr insert_equal
|
||||
(const node_ptr & header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp
|
||||
(node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -226,10 +226,10 @@ class sgtree_algorithms
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr)
|
||||
template<class H_Alpha>
|
||||
static node_ptr insert_before
|
||||
(const node_ptr & header, const node_ptr & pos, const node_ptr & new_node
|
||||
(node_ptr header, node_ptr pos, node_ptr new_node
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -238,9 +238,9 @@ class sgtree_algorithms
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr)
|
||||
template<class H_Alpha>
|
||||
static void push_back(const node_ptr & header, const node_ptr & new_node
|
||||
static void push_back(node_ptr header, node_ptr new_node
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -248,9 +248,9 @@ class sgtree_algorithms
|
||||
rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr)
|
||||
template<class H_Alpha>
|
||||
static void push_front(const node_ptr & header, const node_ptr & new_node
|
||||
static void push_front(node_ptr header, node_ptr new_node
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -261,7 +261,7 @@ class sgtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const KeyType &key
|
||||
(const_node_ptr header, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -274,7 +274,7 @@ class sgtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_check(const const_node_ptr&,const node_ptr&,const KeyType&,KeyNodePtrCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const node_ptr &hint, const KeyType &key
|
||||
(const_node_ptr header, node_ptr hint, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -285,18 +285,18 @@ class sgtree_algorithms
|
||||
return ret;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(const node_ptr&,const node_ptr&,const insert_commit_data&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data&)
|
||||
template<class H_Alpha>
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void insert_unique_commit
|
||||
(const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data
|
||||
(node_ptr header, node_ptr new_value, const insert_commit_data &commit_data
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{ return insert_commit(header, new_value, commit_data, tree_size, h_alpha, max_tree_size); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_unique
|
||||
template<class NodePtrCompare, class H_Alpha, class AlphaByMaxSize>
|
||||
static bool transfer_unique
|
||||
( const node_ptr & header1, NodePtrCompare comp, std::size_t tree1_size, std::size_t &max_tree1_size
|
||||
, const node_ptr &header2, const node_ptr & z, std::size_t tree2_size, std::size_t &max_tree2_size
|
||||
( node_ptr header1, NodePtrCompare comp, std::size_t tree1_size, std::size_t &max_tree1_size
|
||||
, node_ptr header2, node_ptr z, std::size_t tree2_size, std::size_t &max_tree2_size
|
||||
,H_Alpha h_alpha, AlphaByMaxSize alpha_by_maxsize)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
@@ -311,8 +311,8 @@ class sgtree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_equal
|
||||
template<class NodePtrCompare, class H_Alpha, class AlphaByMaxSize>
|
||||
static void transfer_equal
|
||||
( const node_ptr & header1, NodePtrCompare comp, std::size_t tree1_size, std::size_t &max_tree1_size
|
||||
, const node_ptr &header2, const node_ptr & z, std::size_t tree2_size, std::size_t &max_tree2_size
|
||||
( node_ptr header1, NodePtrCompare comp, std::size_t tree1_size, std::size_t &max_tree1_size
|
||||
, node_ptr header2, node_ptr z, std::size_t tree2_size, std::size_t &max_tree2_size
|
||||
,H_Alpha h_alpha, AlphaByMaxSize alpha_by_maxsize)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
@@ -323,13 +323,13 @@ class sgtree_algorithms
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::is_header
|
||||
static bool is_header(const const_node_ptr & p);
|
||||
static bool is_header(const_node_ptr p);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::is_header
|
||||
static void rebalance(const node_ptr & header);
|
||||
static void rebalance(node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::rebalance_subtree
|
||||
static node_ptr rebalance_subtree(const node_ptr & old_root)
|
||||
static node_ptr rebalance_subtree(node_ptr old_root)
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
/// @cond
|
||||
@@ -337,7 +337,7 @@ class sgtree_algorithms
|
||||
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static void insert_equal_upper_bound_check
|
||||
(const node_ptr & header, const KeyType &key
|
||||
(node_ptr header, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
|
||||
{
|
||||
std::size_t depth;
|
||||
@@ -347,7 +347,7 @@ class sgtree_algorithms
|
||||
|
||||
template<class H_Alpha>
|
||||
static void insert_commit
|
||||
(const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data
|
||||
(node_ptr header, node_ptr new_value, const insert_commit_data &commit_data
|
||||
,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
bstree_algo::insert_unique_commit(header, new_value, commit_data);
|
||||
@@ -356,7 +356,7 @@ class sgtree_algorithms
|
||||
|
||||
template<class H_Alpha>
|
||||
static void rebalance_after_insertion
|
||||
(const node_ptr &x, std::size_t depth
|
||||
(node_ptr x, std::size_t depth
|
||||
, std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
|
||||
{
|
||||
if(tree_size > max_tree_size)
|
||||
|
@@ -1995,7 +1995,7 @@ class slist_impl
|
||||
{ x.swap(y); }
|
||||
|
||||
private:
|
||||
void priv_splice_after(const node_ptr & prev_pos_n, slist_impl &x, const node_ptr & before_f_n, const node_ptr & before_l_n)
|
||||
void priv_splice_after(node_ptr prev_pos_n, slist_impl &x, node_ptr before_f_n, node_ptr before_l_n)
|
||||
{
|
||||
if (cache_last && (before_f_n != before_l_n)){
|
||||
if(prev_pos_n == this->get_last_node()){
|
||||
@@ -2008,7 +2008,7 @@ class slist_impl
|
||||
node_algorithms::transfer_after(prev_pos_n, before_f_n, before_l_n);
|
||||
}
|
||||
|
||||
void priv_incorporate_after(const node_ptr & prev_pos_n, const node_ptr & first_n, const node_ptr & before_l_n)
|
||||
void priv_incorporate_after(node_ptr prev_pos_n, node_ptr first_n, node_ptr before_l_n)
|
||||
{
|
||||
if(cache_last){
|
||||
if(prev_pos_n == this->get_last_node()){
|
||||
@@ -2108,11 +2108,11 @@ class slist_impl
|
||||
}
|
||||
|
||||
//circular version
|
||||
static void priv_swap_lists(const node_ptr & this_node, const node_ptr & other_node, detail::bool_<false>)
|
||||
static void priv_swap_lists(node_ptr this_node, node_ptr other_node, detail::bool_<false>)
|
||||
{ node_algorithms::swap_nodes(this_node, other_node); }
|
||||
|
||||
//linear version
|
||||
static void priv_swap_lists(const node_ptr & this_node, const node_ptr & other_node, detail::bool_<true>)
|
||||
static void priv_swap_lists(node_ptr this_node, node_ptr other_node, detail::bool_<true>)
|
||||
{ node_algorithms::swap_trailing_nodes(this_node, other_node); }
|
||||
|
||||
static slist_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
|
||||
|
@@ -54,7 +54,7 @@ struct splaydown_assemble_and_fix_header
|
||||
{
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
|
||||
splaydown_assemble_and_fix_header(const node_ptr & t, const node_ptr & header, const node_ptr &leftmost, const node_ptr &rightmost)
|
||||
splaydown_assemble_and_fix_header(node_ptr t, node_ptr header, node_ptr leftmost, node_ptr rightmost)
|
||||
: t_(t)
|
||||
, null_node_(header)
|
||||
, l_(null_node_)
|
||||
@@ -187,47 +187,47 @@ class splaytree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree
|
||||
static void swap_tree(const node_ptr & header1, const node_ptr & header2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & node2);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr node2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(const node_ptr&)
|
||||
static void unlink(const node_ptr & node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr)
|
||||
static void unlink(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance
|
||||
static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header);
|
||||
static node_ptr unlink_leftmost_without_rebalance(node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&)
|
||||
static bool unique(const const_node_ptr & node);
|
||||
static bool unique(const_node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&)
|
||||
static std::size_t size(const const_node_ptr & header);
|
||||
static std::size_t size(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&)
|
||||
static node_ptr next_node(const node_ptr & node);
|
||||
static node_ptr next_node(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&)
|
||||
static node_ptr prev_node(const node_ptr & node);
|
||||
static node_ptr prev_node(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(const node_ptr&)
|
||||
static void init(const node_ptr & node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr)
|
||||
static void init(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(const node_ptr&)
|
||||
static void init_header(const node_ptr & header);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr)
|
||||
static void init_header(node_ptr header);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr)
|
||||
//! Additional notes: the previous node of z is splayed to speed up range deletions.
|
||||
static void erase(const node_ptr & header, const node_ptr & z)
|
||||
static void erase(node_ptr header, node_ptr z)
|
||||
{
|
||||
//posibility 1
|
||||
if(NodeTraits::get_left(z)){
|
||||
@@ -254,7 +254,7 @@ class splaytree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_unique
|
||||
template<class NodePtrCompare>
|
||||
static bool transfer_unique
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
typename bstree_algo::insert_commit_data commit_data;
|
||||
bool const transferable = bstree_algo::insert_unique_check(header1, z, comp, commit_data).second;
|
||||
@@ -269,7 +269,7 @@ class splaytree_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_equal
|
||||
template<class NodePtrCompare>
|
||||
static void transfer_equal
|
||||
(const node_ptr & header1, NodePtrCompare comp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
splay_down(header1, z, comp);
|
||||
@@ -279,21 +279,21 @@ class splaytree_algorithms
|
||||
}
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,const node_ptr&,Cloner,Disposer)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer)
|
||||
template <class Cloner, class Disposer>
|
||||
static void clone
|
||||
(const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer);
|
||||
(const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer)
|
||||
template<class Disposer>
|
||||
static void clear_and_dispose(const node_ptr & header, Disposer disposer);
|
||||
static void clear_and_dispose(node_ptr header, Disposer disposer);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
//! Additional notes: an element with key `key` is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::size_t count
|
||||
(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{
|
||||
std::pair<node_ptr, node_ptr> ret = equal_range(header, key, comp);
|
||||
std::size_t n = 0;
|
||||
@@ -308,14 +308,14 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::size_t count
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{ return bstree_algo::count(header, key, comp); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
//! Additional notes: the first node of the range is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr lower_bound
|
||||
(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{
|
||||
splay_down(detail::uncast(header), key, comp);
|
||||
node_ptr y = bstree_algo::lower_bound(header, key, comp);
|
||||
@@ -327,14 +327,14 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr lower_bound
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{ return bstree_algo::lower_bound(header, key, comp); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
//! Additional notes: the first node of the range is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr upper_bound
|
||||
(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{
|
||||
splay_down(detail::uncast(header), key, comp);
|
||||
node_ptr y = bstree_algo::upper_bound(header, key, comp);
|
||||
@@ -346,14 +346,14 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr upper_bound
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{ return bstree_algo::upper_bound(header, key, comp); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare)
|
||||
//! Additional notes: the found node of the lower bound is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr find
|
||||
(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{
|
||||
splay_down(detail::uncast(header), key, comp);
|
||||
return bstree_algo::find(header, key, comp);
|
||||
@@ -363,14 +363,14 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr find
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{ return bstree_algo::find(header, key, comp); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
//! Additional notes: the first node of the range is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> equal_range
|
||||
(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{
|
||||
splay_down(detail::uncast(header), key, comp);
|
||||
std::pair<node_ptr, node_ptr> ret = bstree_algo::equal_range(header, key, comp);
|
||||
@@ -382,14 +382,14 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> equal_range
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{ return bstree_algo::equal_range(header, key, comp); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
//! Additional notes: the first node of the range is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> lower_bound_range
|
||||
(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{
|
||||
splay_down(detail::uncast(header), key, comp);
|
||||
std::pair<node_ptr, node_ptr> ret = bstree_algo::lower_bound_range(header, key, comp);
|
||||
@@ -401,14 +401,14 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> lower_bound_range
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
|
||||
{ return bstree_algo::lower_bound_range(header, key, comp); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool)
|
||||
//! Additional notes: the first node of the range is splayed.
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> bounded_range
|
||||
(const node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
(node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
, bool left_closed, bool right_closed)
|
||||
{
|
||||
splay_down(detail::uncast(header), lower_key, comp);
|
||||
@@ -422,61 +422,61 @@ class splaytree_algorithms
|
||||
//! Additional note: no splaying is performed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> bounded_range
|
||||
(const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
(const_node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
, bool left_closed, bool right_closed)
|
||||
{ return bstree_algo::bounded_range(header, lower_key, upper_key, comp, left_closed, right_closed); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_upper_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
//! Additional note: the inserted node is splayed
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_upper_bound
|
||||
(const node_ptr & header, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr header, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
splay_down(header, new_node, comp);
|
||||
return bstree_algo::insert_equal_upper_bound(header, new_node, comp);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal_lower_bound(node_ptr,node_ptr,NodePtrCompare)
|
||||
//! Additional note: the inserted node is splayed
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal_lower_bound
|
||||
(const node_ptr & header, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr header, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
splay_down(header, new_node, comp);
|
||||
return bstree_algo::insert_equal_lower_bound(header, new_node, comp);
|
||||
}
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(const node_ptr&,const node_ptr&,const node_ptr&,NodePtrCompare)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_equal(node_ptr,node_ptr,node_ptr,NodePtrCompare)
|
||||
//! Additional note: the inserted node is splayed
|
||||
template<class NodePtrCompare>
|
||||
static node_ptr insert_equal
|
||||
(const node_ptr & header, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp)
|
||||
(node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp)
|
||||
{
|
||||
splay_down(header, new_node, comp);
|
||||
return bstree_algo::insert_equal(header, hint, new_node, comp);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_before(node_ptr,node_ptr,node_ptr)
|
||||
//! Additional note: the inserted node is splayed
|
||||
static node_ptr insert_before
|
||||
(const node_ptr & header, const node_ptr & pos, const node_ptr & new_node)
|
||||
(node_ptr header, node_ptr pos, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::insert_before(header, pos, new_node);
|
||||
splay_up(new_node, header);
|
||||
return new_node;
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_back(node_ptr,node_ptr)
|
||||
//! Additional note: the inserted node is splayed
|
||||
static void push_back(const node_ptr & header, const node_ptr & new_node)
|
||||
static void push_back(node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::push_back(header, new_node);
|
||||
splay_up(new_node, header);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::push_front(node_ptr,node_ptr)
|
||||
//! Additional note: the inserted node is splayed
|
||||
static void push_front(const node_ptr & header, const node_ptr & new_node)
|
||||
static void push_front(node_ptr header, node_ptr new_node)
|
||||
{
|
||||
bstree_algo::push_front(header, new_node);
|
||||
splay_up(new_node, header);
|
||||
@@ -486,7 +486,7 @@ class splaytree_algorithms
|
||||
//! Additional note: nodes with the given key are splayed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const node_ptr & header, const KeyType &key
|
||||
(node_ptr header, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
|
||||
{
|
||||
splay_down(header, key, comp);
|
||||
@@ -497,7 +497,7 @@ class splaytree_algorithms
|
||||
//! Additional note: nodes with the given key are splayed
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const node_ptr & header, const node_ptr &hint, const KeyType &key
|
||||
(node_ptr header, node_ptr hint, const KeyType &key
|
||||
,KeyNodePtrCompare comp, insert_commit_data &commit_data)
|
||||
{
|
||||
splay_down(header, key, comp);
|
||||
@@ -505,28 +505,28 @@ class splaytree_algorithms
|
||||
}
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(const node_ptr&,const node_ptr&,const insert_commit_data&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::insert_unique_commit(node_ptr,node_ptr,const insert_commit_data&)
|
||||
static void insert_unique_commit
|
||||
(const node_ptr & header, const node_ptr & new_value, const insert_commit_data &commit_data);
|
||||
(node_ptr header, node_ptr new_value, const insert_commit_data &commit_data);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::is_header
|
||||
static bool is_header(const const_node_ptr & p);
|
||||
static bool is_header(const_node_ptr p);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::rebalance
|
||||
static void rebalance(const node_ptr & header);
|
||||
static void rebalance(node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::rebalance_subtree
|
||||
static node_ptr rebalance_subtree(const node_ptr & old_root);
|
||||
static node_ptr rebalance_subtree(node_ptr old_root);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
// bottom-up splay, use data_ as parent for n | complexity : logarithmic | exception : nothrow
|
||||
static void splay_up(const node_ptr & node, const node_ptr & header)
|
||||
static void splay_up(node_ptr node, node_ptr header)
|
||||
{ priv_splay_up<true>(node, header); }
|
||||
|
||||
// top-down splay | complexity : logarithmic | exception : strong, note A
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr splay_down(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp, bool *pfound = 0)
|
||||
static node_ptr splay_down(node_ptr header, const KeyType &key, KeyNodePtrCompare comp, bool *pfound = 0)
|
||||
{ return priv_splay_down<true>(header, key, comp, pfound); }
|
||||
|
||||
private:
|
||||
@@ -535,7 +535,7 @@ class splaytree_algorithms
|
||||
|
||||
// bottom-up splay, use data_ as parent for n | complexity : logarithmic | exception : nothrow
|
||||
template<bool SimpleSplay>
|
||||
static void priv_splay_up(const node_ptr & node, const node_ptr & header)
|
||||
static void priv_splay_up(node_ptr node, node_ptr header)
|
||||
{
|
||||
// If (node == header) do a splay for the right most node instead
|
||||
// this is to boost performance of equal_range/count on equivalent containers in the case
|
||||
@@ -572,7 +572,7 @@ class splaytree_algorithms
|
||||
}
|
||||
|
||||
template<bool SimpleSplay, class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr priv_splay_down(const node_ptr & header, const KeyType &key, KeyNodePtrCompare comp, bool *pfound = 0)
|
||||
static node_ptr priv_splay_down(node_ptr header, const KeyType &key, KeyNodePtrCompare comp, bool *pfound = 0)
|
||||
{
|
||||
//Most splay tree implementations use a dummy/null node to implement.
|
||||
//this function. This has some problems for a generic library like Intrusive:
|
||||
@@ -684,7 +684,7 @@ class splaytree_algorithms
|
||||
}
|
||||
|
||||
// rotate n with its parent | complexity : constant | exception : nothrow
|
||||
static void rotate(const node_ptr & n)
|
||||
static void rotate(node_ptr n)
|
||||
{
|
||||
//procedure rotate_left;
|
||||
// t, right(t), left(right(t)) := right(t), left(right(t)), t
|
||||
|
@@ -41,7 +41,7 @@ struct treap_node_extra_checker
|
||||
typedef ExtraChecker base_checker_t;
|
||||
typedef ValueTraits value_traits;
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||
|
||||
typedef typename base_checker_t::return_type return_type;
|
||||
|
||||
@@ -114,8 +114,8 @@ class treap_algorithms
|
||||
public:
|
||||
typedef NodeTraits node_traits;
|
||||
typedef typename NodeTraits::node node;
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
|
||||
/// @cond
|
||||
private:
|
||||
@@ -127,7 +127,7 @@ class treap_algorithms
|
||||
rerotate_on_destroy& operator=(const rerotate_on_destroy&);
|
||||
|
||||
public:
|
||||
rerotate_on_destroy(const node_ptr & header, const node_ptr & p, std::size_t &n)
|
||||
rerotate_on_destroy(node_ptr header, node_ptr p, std::size_t &n)
|
||||
: header_(header), p_(p), n_(n), remove_it_(true)
|
||||
{}
|
||||
|
||||
@@ -181,33 +181,33 @@ class treap_algorithms
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::get_header(const const_node_ptr&)
|
||||
static node_ptr get_header(const const_node_ptr & n);
|
||||
static node_ptr get_header(const_node_ptr n);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::begin_node
|
||||
static node_ptr begin_node(const const_node_ptr & header);
|
||||
static node_ptr begin_node(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::end_node
|
||||
static node_ptr end_node(const const_node_ptr & header);
|
||||
static node_ptr end_node(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_tree
|
||||
static void swap_tree(const node_ptr & header1, const node_ptr & header2);
|
||||
static void swap_tree(node_ptr header1, node_ptr header2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & node2);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr node2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(const node_ptr&,const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void swap_nodes(const node_ptr & node1, const node_ptr & header1, const node_ptr & node2, const node_ptr & header2);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::swap_nodes(node_ptr,node_ptr,node_ptr,node_ptr)
|
||||
static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & new_node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(const node_ptr&,const node_ptr&,const node_ptr&)
|
||||
static void replace_node(const node_ptr & node_to_be_replaced, const node_ptr & header, const node_ptr & new_node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::replace_node(node_ptr,node_ptr,node_ptr)
|
||||
static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink(node_ptr)
|
||||
template<class NodePtrPriorityCompare>
|
||||
static void unlink(const node_ptr & node, NodePtrPriorityCompare pcomp)
|
||||
static void unlink(node_ptr node, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
node_ptr x = NodeTraits::get_parent(node);
|
||||
if(x){
|
||||
@@ -219,30 +219,30 @@ class treap_algorithms
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unlink_leftmost_without_rebalance
|
||||
static node_ptr unlink_leftmost_without_rebalance(const node_ptr & header);
|
||||
static node_ptr unlink_leftmost_without_rebalance(node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::unique(const const_node_ptr&)
|
||||
static bool unique(const const_node_ptr & node);
|
||||
static bool unique(const_node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::size(const const_node_ptr&)
|
||||
static std::size_t size(const const_node_ptr & header);
|
||||
static std::size_t size(const_node_ptr header);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::next_node(const node_ptr&)
|
||||
static node_ptr next_node(const node_ptr & node);
|
||||
static node_ptr next_node(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::prev_node(const node_ptr&)
|
||||
static node_ptr prev_node(const node_ptr & node);
|
||||
static node_ptr prev_node(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(const node_ptr&)
|
||||
static void init(const node_ptr & node);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init(node_ptr)
|
||||
static void init(node_ptr node);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(const node_ptr&)
|
||||
static void init_header(const node_ptr & header);
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::init_header(node_ptr)
|
||||
static void init_header(node_ptr header);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(const node_ptr&,const node_ptr&)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::erase(node_ptr,node_ptr)
|
||||
template<class NodePtrPriorityCompare>
|
||||
static node_ptr erase(const node_ptr & header, const node_ptr & z, NodePtrPriorityCompare pcomp)
|
||||
static node_ptr erase(node_ptr header, node_ptr z, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
rebalance_for_erasure(header, z, pcomp);
|
||||
bstree_algo::erase(header, z);
|
||||
@@ -250,44 +250,44 @@ class treap_algorithms
|
||||
}
|
||||
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,const node_ptr&,Cloner,Disposer)
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clone(const const_node_ptr&,node_ptr,Cloner,Disposer)
|
||||
template <class Cloner, class Disposer>
|
||||
static void clone
|
||||
(const const_node_ptr & source_header, const node_ptr & target_header, Cloner cloner, Disposer disposer);
|
||||
(const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::clear_and_dispose(const node_ptr&,Disposer)
|
||||
template<class Disposer>
|
||||
static void clear_and_dispose(const node_ptr & header, Disposer disposer);
|
||||
static void clear_and_dispose(node_ptr header, Disposer disposer);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::lower_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr lower_bound
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::upper_bound(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr upper_bound
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::find(const const_node_ptr&, const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static node_ptr find
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::equal_range(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> equal_range
|
||||
(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::bounded_range(const const_node_ptr&,const KeyType&,const KeyType&,KeyNodePtrCompare,bool,bool)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::pair<node_ptr, node_ptr> bounded_range
|
||||
(const const_node_ptr & header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
(const_node_ptr header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp
|
||||
, bool left_closed, bool right_closed);
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::count(const const_node_ptr&,const KeyType&,KeyNodePtrCompare)
|
||||
template<class KeyType, class KeyNodePtrCompare>
|
||||
static std::size_t count(const const_node_ptr & header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
static std::size_t count(const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp);
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
@@ -308,7 +308,7 @@ class treap_algorithms
|
||||
//! <b>Throws</b>: If "comp" throw or "pcomp" throw.
|
||||
template<class NodePtrCompare, class NodePtrPriorityCompare>
|
||||
static node_ptr insert_equal_upper_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::insert_equal_upper_bound_check(h, new_node, comp, commit_data);
|
||||
@@ -333,7 +333,7 @@ class treap_algorithms
|
||||
//! <b>Throws</b>: If "comp" throws.
|
||||
template<class NodePtrCompare, class NodePtrPriorityCompare>
|
||||
static node_ptr insert_equal_lower_bound
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
|
||||
(node_ptr h, node_ptr new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::insert_equal_lower_bound_check(h, new_node, comp, commit_data);
|
||||
@@ -361,7 +361,7 @@ class treap_algorithms
|
||||
//! <b>Throws</b>: If "comp" throw or "pcomp" throw.
|
||||
template<class NodePtrCompare, class NodePtrPriorityCompare>
|
||||
static node_ptr insert_equal
|
||||
(const node_ptr & h, const node_ptr & hint, const node_ptr & new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
|
||||
(node_ptr h, node_ptr hint, node_ptr new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::insert_equal_check(h, hint, new_node, comp, commit_data);
|
||||
@@ -389,7 +389,7 @@ class treap_algorithms
|
||||
//! tree invariants might be broken.
|
||||
template<class NodePtrPriorityCompare>
|
||||
static node_ptr insert_before
|
||||
(const node_ptr & header, const node_ptr & pos, const node_ptr & new_node, NodePtrPriorityCompare pcomp)
|
||||
(node_ptr header, node_ptr pos, node_ptr new_node, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::insert_before_check(header, pos, commit_data);
|
||||
@@ -415,7 +415,7 @@ class treap_algorithms
|
||||
//! tree invariants are broken. This function is slightly faster than
|
||||
//! using "insert_before".
|
||||
template<class NodePtrPriorityCompare>
|
||||
static void push_back(const node_ptr & header, const node_ptr & new_node, NodePtrPriorityCompare pcomp)
|
||||
static void push_back(node_ptr header, node_ptr new_node, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::push_back_check(header, commit_data);
|
||||
@@ -440,7 +440,7 @@ class treap_algorithms
|
||||
//! tree invariants are broken. This function is slightly faster than
|
||||
//! using "insert_before".
|
||||
template<class NodePtrPriorityCompare>
|
||||
static void push_front(const node_ptr & header, const node_ptr & new_node, NodePtrPriorityCompare pcomp)
|
||||
static void push_front(node_ptr header, node_ptr new_node, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::push_front_check(header, commit_data);
|
||||
@@ -483,7 +483,7 @@ class treap_algorithms
|
||||
//! if no more objects are inserted or erased from the set.
|
||||
template<class KeyType, class KeyNodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const KeyType &key
|
||||
(const_node_ptr header, const KeyType &key
|
||||
,KeyNodePtrCompare comp, KeyNodePtrPrioCompare pcomp
|
||||
,insert_commit_data &commit_data)
|
||||
{
|
||||
@@ -535,7 +535,7 @@ class treap_algorithms
|
||||
//! if no more objects are inserted or erased from the set.
|
||||
template<class KeyType, class KeyNodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const node_ptr & hint, const KeyType &key
|
||||
(const_node_ptr header, node_ptr hint, const KeyType &key
|
||||
,KeyNodePtrCompare comp, KeyNodePtrPrioCompare pcomp, insert_commit_data &commit_data)
|
||||
{
|
||||
std::pair<node_ptr, bool> ret =
|
||||
@@ -563,7 +563,7 @@ class treap_algorithms
|
||||
//! previously executed to fill "commit_data". No value should be inserted or
|
||||
//! erased between the "insert_check" and "insert_commit" calls.
|
||||
static void insert_unique_commit
|
||||
(const node_ptr & header, const node_ptr & new_node, const insert_commit_data &commit_data)
|
||||
(node_ptr header, node_ptr new_node, const insert_commit_data &commit_data)
|
||||
{
|
||||
bstree_algo::insert_unique_commit(header, new_node, commit_data);
|
||||
rotate_up_n(header, new_node, commit_data.rotations);
|
||||
@@ -572,7 +572,7 @@ class treap_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_unique
|
||||
template<class NodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
static bool transfer_unique
|
||||
(const node_ptr & header1, NodePtrCompare comp, KeyNodePtrPrioCompare pcomp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, KeyNodePtrPrioCompare pcomp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bool const transferable = insert_unique_check(header1, z, comp, pcomp, commit_data).second;
|
||||
@@ -586,7 +586,7 @@ class treap_algorithms
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_equal
|
||||
template<class NodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
static void transfer_equal
|
||||
(const node_ptr & header1, NodePtrCompare comp, KeyNodePtrPrioCompare pcomp, const node_ptr &header2, const node_ptr & z)
|
||||
(node_ptr header1, NodePtrCompare comp, KeyNodePtrPrioCompare pcomp, node_ptr header2, node_ptr z)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
bstree_algo::insert_equal_upper_bound_check(header1, z, comp, commit_data);
|
||||
@@ -600,14 +600,14 @@ class treap_algorithms
|
||||
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::is_header
|
||||
static bool is_header(const const_node_ptr & p);
|
||||
static bool is_header(const_node_ptr p);
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
/// @cond
|
||||
private:
|
||||
|
||||
template<class NodePtrPriorityCompare>
|
||||
static void rebalance_for_erasure(const node_ptr & header, const node_ptr & z, NodePtrPriorityCompare pcomp)
|
||||
static void rebalance_for_erasure(node_ptr header, node_ptr z, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
std::size_t n = 0;
|
||||
rerotate_on_destroy rb(header, z, n);
|
||||
@@ -631,7 +631,7 @@ class treap_algorithms
|
||||
|
||||
template<class NodePtrPriorityCompare>
|
||||
static void rebalance_check_and_commit
|
||||
(const node_ptr & h, const node_ptr & new_node, NodePtrPriorityCompare pcomp, insert_commit_data &commit_data)
|
||||
(node_ptr h, node_ptr new_node, NodePtrPriorityCompare pcomp, insert_commit_data &commit_data)
|
||||
{
|
||||
rebalance_after_insertion_check(h, commit_data.node, new_node, pcomp, commit_data.rotations);
|
||||
//No-throw
|
||||
@@ -641,7 +641,7 @@ class treap_algorithms
|
||||
|
||||
template<class Key, class KeyNodePriorityCompare>
|
||||
static void rebalance_after_insertion_check
|
||||
(const const_node_ptr &header, const const_node_ptr & up, const Key &k
|
||||
(const_node_ptr header, const_node_ptr up, const Key &k
|
||||
, KeyNodePriorityCompare pcomp, std::size_t &num_rotations)
|
||||
{
|
||||
const_node_ptr upnode(up);
|
||||
@@ -656,7 +656,7 @@ class treap_algorithms
|
||||
}
|
||||
|
||||
template<class NodePtrPriorityCompare>
|
||||
static bool check_invariant(const const_node_ptr & header, NodePtrPriorityCompare pcomp)
|
||||
static bool check_invariant(const_node_ptr header, NodePtrPriorityCompare pcomp)
|
||||
{
|
||||
node_ptr beg = begin_node(header);
|
||||
node_ptr end = end_node(header);
|
||||
|
@@ -498,6 +498,7 @@ class unordered_set
|
||||
typedef typename Base::hasher hasher;
|
||||
typedef typename Base::key_equal key_equal;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE
|
||||
explicit unordered_set ( const bucket_traits &b_traits
|
||||
, const hasher & hash_func = hasher()
|
||||
, const key_equal &equal_func = key_equal()
|
||||
@@ -506,7 +507,8 @@ class unordered_set
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
BOOST_INTRUSIVE_FORCEINLINE unordered_set
|
||||
BOOST_INTRUSIVE_FORCEINLINE
|
||||
unordered_set
|
||||
( Iterator b, Iterator e
|
||||
, const bucket_traits &b_traits
|
||||
, const hasher & hash_func = hasher()
|
||||
@@ -947,6 +949,7 @@ class unordered_multiset
|
||||
typedef typename Base::hasher hasher;
|
||||
typedef typename Base::key_equal key_equal;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE
|
||||
explicit unordered_multiset( const bucket_traits &b_traits
|
||||
, const hasher & hash_func = hasher()
|
||||
, const key_equal &equal_func = key_equal()
|
||||
@@ -954,7 +957,8 @@ class unordered_multiset
|
||||
: Base(b_traits, hash_func, equal_func, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator> BOOST_INTRUSIVE_FORCEINLINE
|
||||
template<class Iterator>
|
||||
BOOST_INTRUSIVE_FORCEINLINE
|
||||
unordered_multiset( Iterator b
|
||||
, Iterator e
|
||||
, const bucket_traits &b_traits
|
||||
|
@@ -85,13 +85,13 @@ struct unordered_node_traits
|
||||
static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return pointer_traits<node_ptr>::static_cast_from(n->next_); }
|
||||
|
||||
static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
static void set_next(node_ptr n, node_ptr next)
|
||||
{ n->next_ = next; }
|
||||
|
||||
static node_ptr get_prev_in_group(const const_node_ptr & n)
|
||||
{ return n->prev_in_group_; }
|
||||
|
||||
static void set_prev_in_group(const node_ptr & n, const node_ptr & prev)
|
||||
static void set_prev_in_group(node_ptr n, node_ptr prev)
|
||||
{ n->prev_in_group_ = prev; }
|
||||
|
||||
static std::size_t get_hash(const const_node_ptr & n)
|
||||
@@ -111,7 +111,7 @@ struct unordered_group_adapter
|
||||
static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return NodeTraits::get_prev_in_group(n); }
|
||||
|
||||
static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
static void set_next(node_ptr n, node_ptr next)
|
||||
{ NodeTraits::set_prev_in_group(n, next); }
|
||||
};
|
||||
|
||||
|
@@ -23,7 +23,7 @@ using namespace boost::posix_time;
|
||||
|
||||
//[perf_list_value_type
|
||||
//Iteration and element count defines
|
||||
const int NumIter = 100;
|
||||
const int NumIter = 4;
|
||||
const int NumElements = 50000;
|
||||
|
||||
using namespace boost::intrusive;
|
||||
|
@@ -35,7 +35,16 @@ class NonVirtualBase
|
||||
: public virtual VirtualBase
|
||||
, public virtual VirtualBase2
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
NonVirtualBase()
|
||||
: dummy()
|
||||
{}
|
||||
|
||||
//<-
|
||||
const int *get_dummy() const { return dummy; }
|
||||
//->
|
||||
|
||||
private:
|
||||
int dummy[10];
|
||||
};
|
||||
|
||||
@@ -44,11 +53,15 @@ class MyClass
|
||||
, public virtual VirtualBase3
|
||||
{
|
||||
int int_;
|
||||
|
||||
public:
|
||||
list_member_hook<> list_hook_;
|
||||
MyClass(int i = 0)
|
||||
: int_(i)
|
||||
{}
|
||||
//<-
|
||||
int get_int() const { return int_; }
|
||||
//->
|
||||
};
|
||||
|
||||
//Define a list that will store MyClass using the public base hook
|
||||
|
Reference in New Issue
Block a user