update boost on linux
This commit is contained in:
@@ -525,46 +525,46 @@ class avl_set
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
avl_set()
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_set()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit avl_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit avl_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
avl_set( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_set( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
avl_set(BOOST_RV_REF(avl_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_set(BOOST_RV_REF(avl_set) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
avl_set& operator=(BOOST_RV_REF(avl_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_set& operator=(BOOST_RV_REF(avl_set) x)
|
||||
{ return static_cast<avl_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const avl_set &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const avl_set &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(avl_set) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(avl_set) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static avl_set &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static avl_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<avl_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const avl_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const avl_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const avl_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static avl_set &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static avl_set &container_from_iterator(iterator it)
|
||||
{ return static_cast<avl_set &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const avl_set &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const avl_set &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const avl_set &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
@@ -1020,46 +1020,46 @@ class avl_multiset
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
avl_multiset()
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_multiset()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit avl_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit avl_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
avl_multiset( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_multiset( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
avl_multiset(BOOST_RV_REF(avl_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_multiset(BOOST_RV_REF(avl_multiset) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
avl_multiset& operator=(BOOST_RV_REF(avl_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avl_multiset& operator=(BOOST_RV_REF(avl_multiset) x)
|
||||
{ return static_cast<avl_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const avl_multiset &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const avl_multiset &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(avl_multiset) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(avl_multiset) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static avl_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static avl_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<avl_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const avl_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const avl_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const avl_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static avl_multiset &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static avl_multiset &container_from_iterator(iterator it)
|
||||
{ return static_cast<avl_multiset &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const avl_multiset &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const avl_multiset &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const avl_multiset &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -535,46 +535,46 @@ class avltree
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
avltree()
|
||||
BOOST_INTRUSIVE_FORCEINLINE avltree()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit avltree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit avltree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
avltree( bool unique, Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE avltree( bool unique, Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
avltree(BOOST_RV_REF(avltree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avltree(BOOST_RV_REF(avltree) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
avltree& operator=(BOOST_RV_REF(avltree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE avltree& operator=(BOOST_RV_REF(avltree) x)
|
||||
{ return static_cast<avltree &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const avltree &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const avltree &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(avltree) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(avltree) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static avltree &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static avltree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<avltree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const avltree &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const avltree &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const avltree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static avltree &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static avltree &container_from_iterator(iterator it)
|
||||
{ return static_cast<avltree &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const avltree &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const avltree &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const avltree &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -522,46 +522,46 @@ class bs_set
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
bs_set()
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_set()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit bs_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit bs_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
bs_set( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_set( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
bs_set(BOOST_RV_REF(bs_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_set(BOOST_RV_REF(bs_set) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
bs_set& operator=(BOOST_RV_REF(bs_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_set& operator=(BOOST_RV_REF(bs_set) x)
|
||||
{ return static_cast<bs_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const bs_set &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const bs_set &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(bs_set) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bs_set) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static bs_set &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<bs_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const bs_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const bs_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static bs_set &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bs_set &container_from_iterator(iterator it)
|
||||
{ return static_cast<bs_set &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const bs_set &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const bs_set &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const bs_set &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
@@ -1016,46 +1016,46 @@ class bs_multiset
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
bs_multiset()
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_multiset()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit bs_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit bs_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
bs_multiset( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_multiset( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
bs_multiset(BOOST_RV_REF(bs_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_multiset(BOOST_RV_REF(bs_multiset) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
bs_multiset& operator=(BOOST_RV_REF(bs_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE bs_multiset& operator=(BOOST_RV_REF(bs_multiset) x)
|
||||
{ return static_cast<bs_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const bs_multiset &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const bs_multiset &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(bs_multiset) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bs_multiset) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static bs_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<bs_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const bs_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const bs_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static bs_multiset &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bs_multiset &container_from_iterator(iterator it)
|
||||
{ return static_cast<bs_multiset &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const bs_multiset &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const bs_multiset &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const bs_multiset &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -255,7 +255,8 @@ struct get_key_of_value<void, T>
|
||||
template<class ValuePtr, class VoidOrKeyOfValue, class VoidOrKeyComp>
|
||||
struct bst_key_types
|
||||
{
|
||||
typedef typename pointer_element<ValuePtr>::type value_type;
|
||||
typedef typename
|
||||
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
||||
typedef typename get_key_of_value
|
||||
< VoidOrKeyOfValue, value_type>::type key_of_value;
|
||||
typedef typename key_of_value::type key_type;
|
||||
@@ -724,15 +725,22 @@ class bstree_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Constructs a container moving resources from another container.
|
||||
//! Internal comparison object and value traits are move constructed and
|
||||
//! nodes belonging to x (except the node representing the "end") are linked to *this.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: If value_traits::node_traits::node's
|
||||
//! move constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
||||
//! or the move constructor of the comparison objet throws.
|
||||
bstree_impl(BOOST_RV_REF(bstree_impl) x)
|
||||
: data_type(::boost::move(x.comp()), ::boost::move(x.get_value_traits()))
|
||||
{
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Equivalent to swap
|
||||
//!
|
||||
BOOST_INTRUSIVE_FORCEINLINE bstree_impl& operator=(BOOST_RV_REF(bstree_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
@@ -2186,46 +2194,46 @@ class bstree
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
bstree()
|
||||
BOOST_INTRUSIVE_FORCEINLINE bstree()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit bstree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit bstree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
bstree( bool unique, Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE bstree( bool unique, Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
bstree(BOOST_RV_REF(bstree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE bstree(BOOST_RV_REF(bstree) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
bstree& operator=(BOOST_RV_REF(bstree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE bstree& operator=(BOOST_RV_REF(bstree) x)
|
||||
{ return static_cast<bstree &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const bstree &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const bstree &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(bstree) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(bstree) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static bstree &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bstree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<bstree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const bstree &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const bstree &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const bstree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static bstree &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static bstree &container_from_iterator(iterator it)
|
||||
{ return static_cast<bstree &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const bstree &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const bstree &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const bstree &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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,12 +559,12 @@ 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());
|
||||
NodeTraits::set_right(node, node_ptr());
|
||||
};
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
|
||||
//!
|
||||
@@ -576,7 +576,7 @@ class bstree_algorithms : public bstree_algorithms_base<NodeTraits>
|
||||
return !NodeTraits::get_parent(node) &&
|
||||
!NodeTraits::get_left(node) &&
|
||||
!NodeTraits::get_right(node) ;
|
||||
};
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: node must not be part of any tree.
|
||||
//!
|
||||
@@ -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,9 +67,9 @@ 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()));
|
||||
const node_ptr null_node = node_ptr();
|
||||
NodeTraits::set_next(this_node, null_node);
|
||||
NodeTraits::set_previous(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);
|
||||
|
||||
@@ -17,33 +17,20 @@
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
#pragma warning (push)
|
||||
//
|
||||
//'function' : resolved overload was found by argument-dependent lookup
|
||||
//A function found by argument-dependent lookup (Koenig lookup) was eventually
|
||||
//chosen by overload resolution.
|
||||
//
|
||||
//In Visual C++ .NET and earlier compilers, a different function would have
|
||||
//been called. To pick the original function, use an explicitly qualified name.
|
||||
//
|
||||
|
||||
//warning C4275: non dll-interface class 'x' used as base for
|
||||
//dll-interface class 'Y'
|
||||
#pragma warning (disable : 4275)
|
||||
//warning C4251: 'x' : class 'y' needs to have dll-interface to
|
||||
//be used by clients of class 'z'
|
||||
#pragma warning (disable : 4251)
|
||||
#pragma warning (disable : 4675)
|
||||
#pragma warning (disable : 4996)
|
||||
#pragma warning (disable : 4503)
|
||||
#pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier"
|
||||
#pragma warning (disable : 4251) // "identifier" : class "type" needs to have dll-interface to be used by clients of class "type2"
|
||||
#pragma warning (disable : 4675) // "method" should be declared "static" and have exactly one parameter
|
||||
#pragma warning (disable : 4996) // "function": was declared deprecated
|
||||
#pragma warning (disable : 4503) // "identifier" : decorated name length exceeded, name was truncated
|
||||
#pragma warning (disable : 4284) // odd return type for operator->
|
||||
#pragma warning (disable : 4244) // possible loss of data
|
||||
#pragma warning (disable : 4521) ////Disable "multiple copy constructors specified"
|
||||
#pragma warning (disable : 4127) //conditional expression is constant
|
||||
#pragma warning (disable : 4146)
|
||||
#pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned
|
||||
#pragma warning (disable : 4267) //conversion from 'X' to 'Y', possible loss of data
|
||||
#pragma warning (disable : 4541) //'typeid' used on polymorphic type 'boost::exception' with /GR-
|
||||
#pragma warning (disable : 4512) //'typeid' used on polymorphic type 'boost::exception' with /GR-
|
||||
#pragma warning (disable : 4522)
|
||||
#pragma warning (disable : 4522) // "class" : multiple assignment operators specified
|
||||
#pragma warning (disable : 4706) //assignment within conditional expression
|
||||
#pragma warning (disable : 4710) // function not inlined
|
||||
#pragma warning (disable : 4714) // "function": marked as __forceinline not inlined
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <boost/intrusive/detail/to_raw_pointer.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -48,7 +48,7 @@ struct default_header_holder : public NodeTraits::node
|
||||
|
||||
// (unsafe) downcast used to implement container-from-iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE static default_header_holder* get_holder(const node_ptr &p)
|
||||
{ return static_cast< default_header_holder* >(boost::intrusive::detail::to_raw_pointer(p)); }
|
||||
{ return static_cast< default_header_holder* >(boost::movelib::to_raw_pointer(p)); }
|
||||
};
|
||||
|
||||
// type function producing the header node holder
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace detail {
|
||||
#define BOOST_INTRUSIVE_TT_DECL
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64) && !defined(_M_ARM) && !defined(UNDER_CE)
|
||||
#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64) && !defined(_M_ARM) && !defined(_M_ARM64) && !defined(UNDER_CE)
|
||||
#define BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
|
||||
#endif
|
||||
|
||||
@@ -158,7 +158,7 @@ template<typename T>
|
||||
struct is_unary_or_binary_function : is_unary_or_binary_function_impl<T>
|
||||
{};
|
||||
|
||||
template<typename T, bool = is_unary_or_binary_function<T>::value>
|
||||
template<typename T, typename Tag = void, bool = is_unary_or_binary_function<T>::value>
|
||||
class ebo_functor_holder
|
||||
{
|
||||
BOOST_COPYABLE_AND_MOVABLE(ebo_functor_holder)
|
||||
@@ -222,8 +222,8 @@ class ebo_functor_holder
|
||||
T t_;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class ebo_functor_holder<T, false>
|
||||
template<typename T, typename Tag>
|
||||
class ebo_functor_holder<T, Tag, false>
|
||||
: public T
|
||||
{
|
||||
BOOST_COPYABLE_AND_MOVABLE(ebo_functor_holder)
|
||||
|
||||
@@ -161,52 +161,52 @@ class generic_hook
|
||||
< NodeTraits
|
||||
, Tag, LinkMode, BaseHookType> hooktags;
|
||||
|
||||
node_ptr this_ptr()
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr this_ptr()
|
||||
{ return pointer_traits<node_ptr>::pointer_to(static_cast<node&>(*this)); }
|
||||
|
||||
const_node_ptr this_ptr() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_node_ptr this_ptr() const
|
||||
{ return pointer_traits<const_node_ptr>::pointer_to(static_cast<const node&>(*this)); }
|
||||
|
||||
public:
|
||||
/// @endcond
|
||||
|
||||
generic_hook()
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook()
|
||||
{
|
||||
if(hooktags::safemode_or_autounlink){
|
||||
node_algorithms::init(this->this_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
generic_hook(const generic_hook& )
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook(const generic_hook& )
|
||||
{
|
||||
if(hooktags::safemode_or_autounlink){
|
||||
node_algorithms::init(this->this_ptr());
|
||||
}
|
||||
}
|
||||
|
||||
generic_hook& operator=(const generic_hook& )
|
||||
BOOST_INTRUSIVE_FORCEINLINE generic_hook& operator=(const generic_hook& )
|
||||
{ return *this; }
|
||||
|
||||
~generic_hook()
|
||||
BOOST_INTRUSIVE_FORCEINLINE ~generic_hook()
|
||||
{
|
||||
destructor_impl
|
||||
(*this, detail::link_dispatch<hooktags::link_mode>());
|
||||
}
|
||||
|
||||
void swap_nodes(generic_hook &other)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void swap_nodes(generic_hook &other)
|
||||
{
|
||||
node_algorithms::swap_nodes
|
||||
(this->this_ptr(), other.this_ptr());
|
||||
}
|
||||
|
||||
bool is_linked() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE bool is_linked() const
|
||||
{
|
||||
//is_linked() can be only used in safe-mode or auto-unlink
|
||||
BOOST_STATIC_ASSERT(( hooktags::safemode_or_autounlink ));
|
||||
return !node_algorithms::unique(this->this_ptr());
|
||||
}
|
||||
|
||||
void unlink()
|
||||
BOOST_INTRUSIVE_FORCEINLINE void unlink()
|
||||
{
|
||||
BOOST_STATIC_ASSERT(( (int)hooktags::link_mode == (int)auto_unlink ));
|
||||
node_ptr n(this->this_ptr());
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
template <class Slist>
|
||||
struct bucket_impl : public Slist
|
||||
@@ -149,8 +148,6 @@ struct get_slist_impl
|
||||
{};
|
||||
};
|
||||
|
||||
} //namespace detail {
|
||||
|
||||
template<class BucketValueTraits, bool IsConst>
|
||||
class hashtable_iterator
|
||||
{
|
||||
@@ -169,17 +166,22 @@ class hashtable_iterator
|
||||
private:
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename detail::get_slist_impl
|
||||
< typename detail::reduced_slist_node_traits
|
||||
typedef typename get_slist_impl
|
||||
< typename reduced_slist_node_traits
|
||||
<node_traits>::type >::type slist_impl;
|
||||
typedef typename slist_impl::iterator siterator;
|
||||
typedef typename slist_impl::const_iterator const_siterator;
|
||||
typedef detail::bucket_impl<slist_impl> bucket_type;
|
||||
typedef bucket_impl<slist_impl> bucket_type;
|
||||
|
||||
typedef typename pointer_traits
|
||||
<pointer>::template rebind_pointer
|
||||
< const BucketValueTraits >::type const_bucketvaltraits_ptr;
|
||||
typedef typename slist_impl::size_type size_type;
|
||||
class nat;
|
||||
typedef typename
|
||||
detail::if_c< IsConst
|
||||
, hashtable_iterator<BucketValueTraits, false>
|
||||
, nat>::type nonconst_iterator;
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr downcast_bucket(typename bucket_type::node_ptr p)
|
||||
{
|
||||
@@ -193,12 +195,16 @@ class hashtable_iterator
|
||||
: slist_it_() //Value initialization to achieve "null iterators" (N3644)
|
||||
{}
|
||||
|
||||
explicit hashtable_iterator(siterator ptr, const BucketValueTraits *cont)
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit hashtable_iterator(siterator ptr, const BucketValueTraits *cont)
|
||||
: slist_it_ (ptr)
|
||||
, traitsptr_ (cont ? pointer_traits<const_bucketvaltraits_ptr>::pointer_to(*cont) : const_bucketvaltraits_ptr() )
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator(const hashtable_iterator<BucketValueTraits, false> &other)
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator(const hashtable_iterator &other)
|
||||
: slist_it_(other.slist_it()), traitsptr_(other.get_bucket_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator(const nonconst_iterator &other)
|
||||
: slist_it_(other.slist_it()), traitsptr_(other.get_bucket_value_traits())
|
||||
{}
|
||||
|
||||
@@ -211,7 +217,10 @@ class hashtable_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator& operator++()
|
||||
{ this->increment(); return *this; }
|
||||
|
||||
hashtable_iterator operator++(int)
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator &operator=(const hashtable_iterator &other)
|
||||
{ slist_it_ = other.slist_it(); traitsptr_ = other.get_bucket_value_traits(); return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator operator++(int)
|
||||
{
|
||||
hashtable_iterator result (*this);
|
||||
this->increment();
|
||||
@@ -246,7 +255,7 @@ class hashtable_iterator
|
||||
void increment()
|
||||
{
|
||||
const bucket_traits &rbuck_traits = this->priv_bucket_traits();
|
||||
bucket_type* const buckets = boost::intrusive::detail::to_raw_pointer(rbuck_traits.bucket_begin());
|
||||
bucket_type* const buckets = boost::movelib::to_raw_pointer(rbuck_traits.bucket_begin());
|
||||
const size_type buckets_len = rbuck_traits.bucket_count();
|
||||
|
||||
++slist_it_;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <boost/intrusive/detail/parent_from_member.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/intrusive/detail/to_raw_pointer.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
#include <boost/intrusive/detail/node_holder.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -57,26 +57,34 @@ struct bhtraits_base
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n)
|
||||
{
|
||||
return pointer_traits<pointer>::pointer_to
|
||||
pointer p = pointer_traits<pointer>::pointer_to
|
||||
(static_cast<reference>(static_cast<node_holder_reference>(*n)));
|
||||
BOOST_ASSERT(!!p);
|
||||
return p;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n)
|
||||
{
|
||||
return pointer_traits<const_pointer>::pointer_to
|
||||
const_pointer p = pointer_traits<const_pointer>::pointer_to
|
||||
(static_cast<const_reference>(static_cast<const_node_holder_reference>(*n)));
|
||||
BOOST_ASSERT(!!p);
|
||||
return p;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value)
|
||||
{
|
||||
return pointer_traits<node_ptr>::pointer_to
|
||||
node_ptr p = pointer_traits<node_ptr>::pointer_to
|
||||
(static_cast<node_reference>(static_cast<node_holder_reference>(value)));
|
||||
BOOST_ASSERT(!!p);
|
||||
return p;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value)
|
||||
{
|
||||
return pointer_traits<const_node_ptr>::pointer_to
|
||||
const_node_ptr p = pointer_traits<const_node_ptr>::pointer_to
|
||||
(static_cast<const_node_reference>(static_cast<const_node_holder_reference>(value)));
|
||||
BOOST_ASSERT(!!p);
|
||||
return p;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -128,14 +136,14 @@ struct mhtraits
|
||||
{
|
||||
return pointer_traits<pointer>::pointer_to
|
||||
(*detail::parent_from_member<T, Hook>
|
||||
(static_cast<Hook*>(boost::intrusive::detail::to_raw_pointer(n)), P));
|
||||
(static_cast<Hook*>(boost::movelib::to_raw_pointer(n)), P));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n)
|
||||
{
|
||||
return pointer_traits<const_pointer>::pointer_to
|
||||
(*detail::parent_from_member<T, Hook>
|
||||
(static_cast<const Hook*>(boost::intrusive::detail::to_raw_pointer(n)), P));
|
||||
(static_cast<const Hook*>(boost::movelib::to_raw_pointer(n)), P));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -161,10 +169,10 @@ struct fhtraits
|
||||
static const link_mode_type link_mode = hook_type::hooktags::link_mode;
|
||||
|
||||
static node_ptr to_node_ptr(reference value)
|
||||
{ return static_cast<node*>(boost::intrusive::detail::to_raw_pointer(Functor::to_hook_ptr(value))); }
|
||||
{ return static_cast<node*>(boost::movelib::to_raw_pointer(Functor::to_hook_ptr(value))); }
|
||||
|
||||
static const_node_ptr to_node_ptr(const_reference value)
|
||||
{ return static_cast<const node*>(boost::intrusive::detail::to_raw_pointer(Functor::to_hook_ptr(value))); }
|
||||
{ return static_cast<const node*>(boost::movelib::to_raw_pointer(Functor::to_hook_ptr(value))); }
|
||||
|
||||
static pointer to_value_ptr(const node_ptr & n)
|
||||
{ return Functor::to_value_ptr(to_hook_ptr(n)); }
|
||||
|
||||
@@ -27,6 +27,24 @@
|
||||
#include <boost/move/detail/iterator_traits.hpp>
|
||||
#include <boost/move/detail/meta_utils_core.hpp>
|
||||
|
||||
namespace boost{
|
||||
namespace iterators{
|
||||
|
||||
struct incrementable_traversal_tag;
|
||||
struct single_pass_traversal_tag;
|
||||
struct forward_traversal_tag;
|
||||
struct bidirectional_traversal_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class Category, class Traversal>
|
||||
struct iterator_category_with_traversal;
|
||||
|
||||
} //namespace boost{
|
||||
} //namespace iterators{
|
||||
} //namespace detail{
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
@@ -45,6 +63,28 @@ struct iterator
|
||||
typedef Reference reference;
|
||||
};
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_[dis|en]able_if_boost_iterator
|
||||
////////////////////////////////////////
|
||||
template<class I>
|
||||
struct is_boost_iterator
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template<class Category, class Traversal>
|
||||
struct is_boost_iterator< boost::iterators::detail::iterator_category_with_traversal<Category, Traversal> >
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template<class I, class R = void>
|
||||
struct iterator_enable_if_boost_iterator
|
||||
: ::boost::move_detail::enable_if_c
|
||||
< is_boost_iterator<typename boost::intrusive::iterator_traits<I>::iterator_category >::value
|
||||
, R>
|
||||
{};
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_[dis|en]able_if_tag
|
||||
////////////////////////////////////////
|
||||
@@ -68,6 +108,23 @@ struct iterator_disable_if_tag
|
||||
, R>
|
||||
{};
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_[dis|en]able_if_tag
|
||||
////////////////////////////////////////
|
||||
template<class I, class Tag, class Tag2, class R = void>
|
||||
struct iterator_enable_if_convertible_tag
|
||||
: ::boost::move_detail::enable_if_c
|
||||
< ::boost::move_detail::is_same_or_convertible
|
||||
< typename boost::intrusive::iterator_traits<I>::iterator_category
|
||||
, Tag
|
||||
>::value &&
|
||||
!::boost::move_detail::is_same_or_convertible
|
||||
< typename boost::intrusive::iterator_traits<I>::iterator_category
|
||||
, Tag2
|
||||
>::value
|
||||
, R>
|
||||
{};
|
||||
|
||||
////////////////////////////////////////
|
||||
// iterator_[dis|en]able_if_tag_difference_type
|
||||
////////////////////////////////////////
|
||||
@@ -84,12 +141,13 @@ struct iterator_disable_if_tag_difference_type
|
||||
////////////////////
|
||||
// advance
|
||||
////////////////////
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
typename iterator_enable_if_tag<InputIt, std::input_iterator_tag>::type
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::input_iterator_tag>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
@@ -97,17 +155,17 @@ typename iterator_enable_if_tag<InputIt, std::forward_iterator_tag>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
typename iterator_enable_if_tag<InputIt, std::bidirectional_iterator_tag>::type
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::bidirectional_iterator_tag>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
for (; 0 < n; --n)
|
||||
++it;
|
||||
++it;
|
||||
for (; n < 0; ++n)
|
||||
--it;
|
||||
--it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
@@ -117,6 +175,54 @@ BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::random
|
||||
it += n;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::incrementable_traversal_tag&, const boost::iterators::single_pass_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::single_pass_traversal_tag &, const boost::iterators::forward_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::forward_traversal_tag&, const boost::iterators::bidirectional_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
while(n--)
|
||||
++it;
|
||||
}
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::bidirectional_traversal_tag&, const boost::iterators::random_access_traversal_tag&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
for (; 0 < n; --n)
|
||||
++it;
|
||||
for (; n < 0; ++n)
|
||||
--it;
|
||||
}
|
||||
|
||||
class fake{};
|
||||
|
||||
template<class InputIt, class Distance>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_convertible_tag
|
||||
<InputIt, const boost::iterators::random_access_traversal_tag&, const fake&>::type
|
||||
iterator_advance(InputIt& it, Distance n)
|
||||
{
|
||||
it += n;
|
||||
}
|
||||
|
||||
////////////////////
|
||||
// distance
|
||||
////////////////////
|
||||
@@ -127,7 +233,7 @@ typename iterator_disable_if_tag_difference_type
|
||||
{
|
||||
typename iterator_traits<InputIt>::difference_type off = 0;
|
||||
while(first != last){
|
||||
++off;
|
||||
++off;
|
||||
++first;
|
||||
}
|
||||
return off;
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
static const bool value = same_type || is_convertible<P1, const_node_ptr>::value;
|
||||
};
|
||||
|
||||
base_t base() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE base_t base() const
|
||||
{ return static_cast<const base_t&>(*this); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE key_nodeptr_comp(KeyTypeKeyCompare kcomp, const ValueTraits *traits)
|
||||
|
||||
@@ -47,6 +47,11 @@ class list_iterator
|
||||
typedef typename types_t::node node;
|
||||
typedef typename types_t::node_ptr node_ptr;
|
||||
typedef typename types_t::const_value_traits_ptr const_value_traits_ptr;
|
||||
class nat;
|
||||
typedef typename
|
||||
detail::if_c< IsConst
|
||||
, list_iterator<value_traits, false>
|
||||
, nat>::type nonconst_iterator;
|
||||
|
||||
public:
|
||||
typedef typename types_t::iterator_type::difference_type difference_type;
|
||||
@@ -62,15 +67,22 @@ class list_iterator
|
||||
: members_(nodeptr, traits_ptr)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator(list_iterator<ValueTraits, false> const& other)
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator(const list_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator(const nonconst_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const list_iterator &other)
|
||||
{ members_.nodeptr_ = other.members_.nodeptr_; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
|
||||
{ members_.nodeptr_ = node; return static_cast<list_iterator&>(*this); }
|
||||
{ members_.nodeptr_ = node; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
|
||||
{ return members_.get_ptr(); }
|
||||
@@ -115,7 +127,7 @@ class list_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
|
||||
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
|
||||
|
||||
list_iterator<ValueTraits, false> unconst() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE list_iterator<ValueTraits, false> unconst() const
|
||||
{ return list_iterator<ValueTraits, false>(this->pointed_node(), this->get_value_traits()); }
|
||||
|
||||
private:
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ template<class SizeType, class Enabler = void >
|
||||
struct sqrt2_pow_max;
|
||||
|
||||
template <class SizeType>
|
||||
struct sqrt2_pow_max<SizeType, typename enable_if< numbits_eq<SizeType, 32> >::type>
|
||||
struct sqrt2_pow_max<SizeType, typename voider<typename enable_if< numbits_eq<SizeType, 32> >::type>::type>
|
||||
{
|
||||
static const SizeType value = 0xb504f334;
|
||||
static const std::size_t pow = 31;
|
||||
@@ -271,7 +271,7 @@ struct sqrt2_pow_max<SizeType, typename enable_if< numbits_eq<SizeType, 32> >::t
|
||||
#ifndef BOOST_NO_INT64_T
|
||||
|
||||
template <class SizeType>
|
||||
struct sqrt2_pow_max<SizeType, typename enable_if< numbits_eq<SizeType, 64> >::type>
|
||||
struct sqrt2_pow_max<SizeType, typename voider<typename enable_if< numbits_eq<SizeType, 64> >::type>::type>
|
||||
{
|
||||
static const SizeType value = 0xb504f333f9de6484ull;
|
||||
static const std::size_t pow = 63;
|
||||
|
||||
@@ -40,6 +40,7 @@ using boost::move_detail::remove_pointer;
|
||||
using boost::move_detail::add_pointer;
|
||||
using boost::move_detail::true_type;
|
||||
using boost::move_detail::false_type;
|
||||
using boost::move_detail::voider;
|
||||
using boost::move_detail::enable_if_c;
|
||||
using boost::move_detail::enable_if;
|
||||
using boost::move_detail::disable_if_c;
|
||||
@@ -86,8 +87,8 @@ struct ls_zeros<1>
|
||||
|
||||
// Infrastructure for providing a default type for T::TNAME if absent.
|
||||
#define BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(TNAME) \
|
||||
template <typename T, typename DefaultType> \
|
||||
struct boost_intrusive_default_type_ ## TNAME \
|
||||
template <typename T> \
|
||||
struct boost_intrusive_has_type_ ## TNAME \
|
||||
{ \
|
||||
template <typename X> \
|
||||
static char test(int, typename X::TNAME*); \
|
||||
@@ -95,13 +96,18 @@ struct ls_zeros<1>
|
||||
template <typename X> \
|
||||
static int test(...); \
|
||||
\
|
||||
struct DefaultWrap { typedef DefaultType TNAME; }; \
|
||||
\
|
||||
static const bool value = (1 == sizeof(test<T>(0, 0))); \
|
||||
}; \
|
||||
\
|
||||
template <typename T, typename DefaultType> \
|
||||
struct boost_intrusive_default_type_ ## TNAME \
|
||||
{ \
|
||||
struct DefaultWrap { typedef DefaultType TNAME; }; \
|
||||
\
|
||||
typedef typename \
|
||||
::boost::intrusive::detail::if_c \
|
||||
<value, T, DefaultWrap>::type::TNAME type; \
|
||||
< boost_intrusive_has_type_ ## TNAME<T>::value \
|
||||
, T, DefaultWrap>::type::TNAME type; \
|
||||
}; \
|
||||
//
|
||||
|
||||
@@ -110,6 +116,11 @@ struct ls_zeros<1>
|
||||
boost_intrusive_default_type_ ## TNAME< T, TIMPL >::type \
|
||||
//
|
||||
|
||||
#define BOOST_INTRUSIVE_HAS_TYPE(INSTANTIATION_NS_PREFIX, T, TNAME) \
|
||||
INSTANTIATION_NS_PREFIX \
|
||||
boost_intrusive_has_type_ ## TNAME< T >::value \
|
||||
//
|
||||
|
||||
#define BOOST_INTRUSIVE_INSTANTIATE_EVAL_DEFAULT_TYPE_TMPLT(TNAME)\
|
||||
template <typename T, typename DefaultType> \
|
||||
struct boost_intrusive_eval_default_type_ ## TNAME \
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -59,7 +59,7 @@ struct constptr
|
||||
{}
|
||||
|
||||
const void *get_ptr() const
|
||||
{ return boost::intrusive::detail::to_raw_pointer(const_void_ptr_); }
|
||||
{ return boost::movelib::to_raw_pointer(const_void_ptr_); }
|
||||
|
||||
ConstVoidPtr const_void_ptr_;
|
||||
};
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/intrusive for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail{
|
||||
|
||||
//////////////////////
|
||||
//struct first_param
|
||||
//////////////////////
|
||||
|
||||
template <typename T> struct first_param
|
||||
{ typedef void type; };
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
template <template <typename, typename...> class TemplateClass, typename T, typename... Args>
|
||||
struct first_param< TemplateClass<T, Args...> >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
#else //C++03 compilers
|
||||
|
||||
template < template //0arg
|
||||
<class
|
||||
> class TemplateClass, class T
|
||||
>
|
||||
struct first_param
|
||||
< TemplateClass<T> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //1arg
|
||||
<class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //2arg
|
||||
<class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //3arg
|
||||
<class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //4arg
|
||||
<class,class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2, class P3>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2, P3> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //5arg
|
||||
<class,class,class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2, class P3, class P4>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2, P3, P4> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //6arg
|
||||
<class,class,class,class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2, class P3, class P4, class P5>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2, P3, P4, P5> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //7arg
|
||||
<class,class,class,class,class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2, class P3, class P4, class P5, class P6>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2, P3, P4, P5, P6> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //8arg
|
||||
<class,class,class,class,class,class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2, P3, P4, P5, P6, P7> >
|
||||
{ typedef T type; };
|
||||
|
||||
template < template //9arg
|
||||
<class,class,class,class,class,class,class,class,class,class
|
||||
> class TemplateClass, class T
|
||||
, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8>
|
||||
struct first_param
|
||||
< TemplateClass<T, P0, P1, P2, P3, P4, P5, P6, P7, P8> >
|
||||
{ typedef T type; };
|
||||
|
||||
#endif //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename T>
|
||||
struct has_internal_pointer_element
|
||||
{
|
||||
template <typename X>
|
||||
static char test(int, typename X::element_type*);
|
||||
|
||||
template <typename X>
|
||||
static int test(...);
|
||||
|
||||
static const bool value = (1 == sizeof(test<T>(0, 0)));
|
||||
};
|
||||
|
||||
template<class Ptr, bool = has_internal_pointer_element<Ptr>::value>
|
||||
struct pointer_element_impl
|
||||
{
|
||||
typedef typename Ptr::element_type type;
|
||||
};
|
||||
|
||||
template<class Ptr>
|
||||
struct pointer_element_impl<Ptr, false>
|
||||
{
|
||||
typedef typename boost::intrusive::detail::first_param<Ptr>::type type;
|
||||
};
|
||||
|
||||
} //namespace detail{
|
||||
|
||||
template <typename Ptr>
|
||||
struct pointer_element
|
||||
{
|
||||
typedef typename ::boost::intrusive::detail::pointer_element_impl<Ptr>::type type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct pointer_element<T*>
|
||||
{ typedef T type; };
|
||||
|
||||
} //namespace container {
|
||||
} //namespace boost {
|
||||
|
||||
#endif // defined(BOOST_INTRUSIVE_DETAIL_POINTER_ELEMENT_HPP)
|
||||
@@ -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); }
|
||||
};
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@ class slist_iterator
|
||||
typedef typename types_t::node node;
|
||||
typedef typename types_t::node_ptr node_ptr;
|
||||
typedef typename types_t::const_value_traits_ptr const_value_traits_ptr;
|
||||
class nat;
|
||||
typedef typename
|
||||
detail::if_c< IsConst
|
||||
, slist_iterator<value_traits, false>
|
||||
, nat>::type nonconst_iterator;
|
||||
|
||||
public:
|
||||
typedef typename types_t::iterator_type::difference_type difference_type;
|
||||
@@ -64,11 +69,18 @@ class slist_iterator
|
||||
: members_(nodeptr, traits_ptr)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator(slist_iterator<ValueTraits, false> const& other)
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator(const slist_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator(const nonconst_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const slist_iterator &other)
|
||||
{ members_.nodeptr_ = other.members_.nodeptr_; return *this; }
|
||||
|
||||
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; }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2014-2014
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org/libs/intrusive for documentation.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BOOST_INTRUSIVE_DETAIL_TO_RAW_POINTER_HPP
|
||||
#define BOOST_INTRUSIVE_DETAIL_TO_RAW_POINTER_HPP
|
||||
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
# include <boost/config.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
#include <boost/intrusive/detail/pointer_element.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
namespace detail {
|
||||
|
||||
template <class T>
|
||||
BOOST_INTRUSIVE_FORCEINLINE T* to_raw_pointer(T* p)
|
||||
{ return p; }
|
||||
|
||||
template <class Pointer>
|
||||
BOOST_INTRUSIVE_FORCEINLINE typename boost::intrusive::pointer_element<Pointer>::type*
|
||||
to_raw_pointer(const Pointer &p)
|
||||
{ return boost::intrusive::detail::to_raw_pointer(p.operator->()); }
|
||||
|
||||
} //namespace detail
|
||||
} //namespace intrusive
|
||||
} //namespace boost
|
||||
|
||||
#include <boost/intrusive/detail/config_end.hpp>
|
||||
|
||||
#endif //BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP
|
||||
@@ -55,6 +55,11 @@ class tree_iterator
|
||||
|
||||
void unspecified_bool_type_func() const {}
|
||||
typedef void (tree_iterator::*unspecified_bool_type)() const;
|
||||
class nat;
|
||||
typedef typename
|
||||
detail::if_c< IsConst
|
||||
, tree_iterator<value_traits, false>
|
||||
, nat>::type nonconst_iterator;
|
||||
|
||||
public:
|
||||
typedef typename types_t::iterator_type::difference_type difference_type;
|
||||
@@ -70,21 +75,28 @@ class tree_iterator
|
||||
: members_(nodeptr, traits_ptr)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator(tree_iterator<value_traits, false> const& other)
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator(const tree_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator(const nonconst_iterator &other)
|
||||
: members_(other.pointed_node(), other.get_value_traits())
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const tree_iterator &other)
|
||||
{ members_.nodeptr_ = other.members_.nodeptr_; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const node_ptr &nodeptr)
|
||||
{ members_.nodeptr_ = nodeptr; return static_cast<tree_iterator&>(*this); }
|
||||
{ members_.nodeptr_ = nodeptr; return *this; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
|
||||
{ return members_.nodeptr_; }
|
||||
|
||||
public:
|
||||
tree_iterator& operator++()
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator& operator++()
|
||||
{
|
||||
members_.nodeptr_ = node_algorithms::next_node(members_.nodeptr_);
|
||||
return static_cast<tree_iterator&> (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
tree_iterator operator++(int)
|
||||
@@ -94,10 +106,10 @@ class tree_iterator
|
||||
return result;
|
||||
}
|
||||
|
||||
tree_iterator& operator--()
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator& operator--()
|
||||
{
|
||||
members_.nodeptr_ = node_algorithms::prev_node(members_.nodeptr_);
|
||||
return static_cast<tree_iterator&> (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
tree_iterator operator--(int)
|
||||
@@ -110,19 +122,19 @@ class tree_iterator
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_left()
|
||||
{
|
||||
members_.nodeptr_ = node_traits::get_left(members_.nodeptr_);
|
||||
return static_cast<tree_iterator&> (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_right()
|
||||
{
|
||||
members_.nodeptr_ = node_traits::get_right(members_.nodeptr_);
|
||||
return static_cast<tree_iterator&> (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_parent()
|
||||
{
|
||||
members_.nodeptr_ = node_traits::get_parent(members_.nodeptr_);
|
||||
return static_cast<tree_iterator&> (*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE operator unspecified_bool_type() const
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
@@ -37,19 +37,22 @@ struct disable_if_smartref_to
|
||||
|| detail::is_same
|
||||
<From, typename pointer_traits
|
||||
< typename pointer_rebind
|
||||
<ValuePtr, const typename pointer_element<ValuePtr>::type>::type>
|
||||
< ValuePtr
|
||||
, const typename boost::movelib::pointer_element<ValuePtr>::type>::type>
|
||||
::reference>::value
|
||||
>
|
||||
{};
|
||||
|
||||
//This function object takes a KeyCompare function object
|
||||
//and compares values that contains keys using KeyOfValue
|
||||
template< class ValuePtr, class KeyCompare, class KeyOfValue
|
||||
, bool = boost::intrusive::detail::is_same<typename pointer_element<ValuePtr>::type, typename KeyOfValue::type>::value >
|
||||
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
|
||||
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
|
||||
{
|
||||
typedef typename pointer_element<ValuePtr>::type value_type;
|
||||
typedef typename
|
||||
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
||||
typedef KeyCompare key_compare;
|
||||
typedef KeyOfValue key_of_value;
|
||||
typedef typename KeyOfValue::type key_type;
|
||||
@@ -77,44 +80,56 @@ 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 pointer_element<ValuePtr>::type value_type;
|
||||
typedef typename
|
||||
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
||||
typedef KeyCompare key_compare;
|
||||
typedef KeyOfValue key_of_value;
|
||||
typedef typename KeyOfValue::type key_type;
|
||||
@@ -143,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); }
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define BOOST_INTRUSIVE_I ,
|
||||
#define BOOST_INTRUSIVE_DOCIGN(T1) T1
|
||||
|
||||
#define BOOST_INTRUSIVE_DISABLE_FORCEINLINE
|
||||
//#define BOOST_INTRUSIVE_DISABLE_FORCEINLINE
|
||||
|
||||
#if defined(BOOST_INTRUSIVE_DISABLE_FORCEINLINE)
|
||||
#define BOOST_INTRUSIVE_FORCEINLINE inline
|
||||
|
||||
@@ -115,8 +115,89 @@ bool priv_algo_is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, F
|
||||
template<int Dummy = 0>
|
||||
struct prime_list_holder
|
||||
{
|
||||
private:
|
||||
|
||||
template <class SizeType> // sizeof(SizeType) < sizeof(std::size_t)
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType truncate_size_type(std::size_t n, detail::true_)
|
||||
{
|
||||
return n < std::size_t(SizeType(-1)) ? static_cast<SizeType>(n) : SizeType(-1);
|
||||
}
|
||||
|
||||
template <class SizeType> // sizeof(SizeType) == sizeof(std::size_t)
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType truncate_size_type(std::size_t n, detail::false_)
|
||||
{
|
||||
return static_cast<SizeType>(n);
|
||||
}
|
||||
|
||||
template <class SizeType> //sizeof(SizeType) > sizeof(std::size_t)
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType suggested_upper_bucket_count_dispatch(SizeType n, detail::true_)
|
||||
{
|
||||
std::size_t const c = n > std::size_t(-1)
|
||||
? std::size_t(-1)
|
||||
: suggested_upper_bucket_count_impl(static_cast<std::size_t>(n));
|
||||
return static_cast<SizeType>(c);
|
||||
}
|
||||
|
||||
template <class SizeType> //sizeof(SizeType) > sizeof(std::size_t)
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType suggested_lower_bucket_count_dispatch(SizeType n, detail::true_)
|
||||
{
|
||||
std::size_t const c = n > std::size_t(-1)
|
||||
? std::size_t(-1)
|
||||
: suggested_lower_bucket_count_impl(static_cast<std::size_t>(n));
|
||||
return static_cast<SizeType>(c);
|
||||
}
|
||||
|
||||
template <class SizeType>
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType suggested_upper_bucket_count_dispatch(SizeType n, detail::false_)
|
||||
{
|
||||
std::size_t const c = suggested_upper_bucket_count_impl(static_cast<std::size_t>(n));
|
||||
return truncate_size_type<SizeType>(c, detail::bool_<(sizeof(SizeType) < sizeof(std::size_t))>());
|
||||
|
||||
}
|
||||
|
||||
template <class SizeType>
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType suggested_lower_bucket_count_dispatch(SizeType n, detail::false_)
|
||||
{
|
||||
std::size_t const c = suggested_lower_bucket_count_impl(static_cast<std::size_t>(n));
|
||||
return truncate_size_type<SizeType>(c, detail::bool_<(sizeof(SizeType) < sizeof(std::size_t))>());
|
||||
}
|
||||
|
||||
static const std::size_t prime_list[];
|
||||
static const std::size_t prime_list_size;
|
||||
|
||||
static std::size_t suggested_lower_bucket_count_impl(std::size_t n)
|
||||
{
|
||||
const std::size_t *primes = &prime_list_holder<0>::prime_list[0];
|
||||
const std::size_t *primes_end = primes + prime_list_holder<0>::prime_list_size;
|
||||
std::size_t const* bound = std::lower_bound(primes, primes_end, n);
|
||||
//Tables have upper SIZE_MAX, so we must always found an entry
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(bound != primes_end);
|
||||
bound -= std::size_t(bound != primes);
|
||||
return *bound;
|
||||
}
|
||||
|
||||
static std::size_t suggested_upper_bucket_count_impl(std::size_t n)
|
||||
{
|
||||
const std::size_t *primes = &prime_list_holder<0>::prime_list[0];
|
||||
const std::size_t *primes_end = primes + prime_list_holder<0>::prime_list_size;
|
||||
std::size_t const* bound = std::upper_bound(primes, primes_end, n);
|
||||
bound -= std::size_t(bound == primes_end);
|
||||
return *bound;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
template <class SizeType>
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType suggested_upper_bucket_count(SizeType n)
|
||||
{
|
||||
return (suggested_upper_bucket_count_dispatch)(n, detail::bool_<(sizeof(SizeType) > sizeof(std::size_t))>());
|
||||
}
|
||||
|
||||
template <class SizeType>
|
||||
static BOOST_INTRUSIVE_FORCEINLINE SizeType suggested_lower_bucket_count(SizeType n)
|
||||
{
|
||||
return (suggested_lower_bucket_count_dispatch)(n, detail::bool_<(sizeof(SizeType) > sizeof(std::size_t))>());
|
||||
}
|
||||
};
|
||||
|
||||
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
||||
@@ -166,9 +247,9 @@ const std::size_t prime_list_holder<Dummy>::prime_list[] = {
|
||||
BOOST_INTRUSIVE_PRIME_C(432345564227567621), BOOST_INTRUSIVE_PRIME_C(864691128455135207),
|
||||
BOOST_INTRUSIVE_PRIME_C(1729382256910270481), BOOST_INTRUSIVE_PRIME_C(3458764513820540933),
|
||||
BOOST_INTRUSIVE_PRIME_C(6917529027641081903), BOOST_INTRUSIVE_PRIME_C(13835058055282163729),
|
||||
BOOST_INTRUSIVE_PRIME_C(18446744073709551557)
|
||||
BOOST_INTRUSIVE_PRIME_C(18446744073709551557), BOOST_INTRUSIVE_PRIME_C(18446744073709551615) //Upper limit, just in case
|
||||
#else
|
||||
BOOST_INTRUSIVE_PRIME_C(4294967291)
|
||||
BOOST_INTRUSIVE_PRIME_C(4294967291), BOOST_INTRUSIVE_PRIME_C(4294967295) //Upper limit, just in case
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -211,7 +292,7 @@ struct unordered_bucket_impl
|
||||
typedef typename
|
||||
get_slist_impl_from_supposed_value_traits
|
||||
<SupposedValueTraits>::type slist_impl;
|
||||
typedef detail::bucket_impl<slist_impl> implementation_defined;
|
||||
typedef bucket_impl<slist_impl> implementation_defined;
|
||||
typedef implementation_defined type;
|
||||
};
|
||||
|
||||
@@ -294,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
|
||||
@@ -325,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;
|
||||
@@ -335,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
|
||||
@@ -348,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_)
|
||||
@@ -368,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_)
|
||||
@@ -488,7 +569,7 @@ struct unordered_default_bucket_traits
|
||||
typedef typename detail::
|
||||
get_slist_impl_from_supposed_value_traits
|
||||
<supposed_value_traits>::type slist_impl;
|
||||
typedef detail::bucket_traits_impl
|
||||
typedef bucket_traits_impl
|
||||
<slist_impl> implementation_defined;
|
||||
typedef implementation_defined type;
|
||||
};
|
||||
@@ -523,10 +604,10 @@ struct downcast_node_to_value_t
|
||||
: public detail::node_to_value<ValueTraits, IsConst>
|
||||
{
|
||||
typedef detail::node_to_value<ValueTraits, IsConst> base_t;
|
||||
typedef typename base_t::result_type result_type;
|
||||
typedef typename base_t::result_type result_type;
|
||||
typedef ValueTraits value_traits;
|
||||
typedef typename detail::get_slist_impl
|
||||
<typename detail::reduced_slist_node_traits
|
||||
typedef typename get_slist_impl
|
||||
<typename reduced_slist_node_traits
|
||||
<typename value_traits::node_traits>::type
|
||||
>::type slist_impl;
|
||||
typedef typename detail::add_const_if_c
|
||||
@@ -588,12 +669,11 @@ struct bucket_plus_vtraits
|
||||
typedef typename value_traits::node_traits node_traits;
|
||||
typedef unordered_group_adapter<node_traits> group_traits;
|
||||
typedef typename slist_impl::iterator siterator;
|
||||
typedef typename slist_impl::size_type size_type;
|
||||
typedef detail::bucket_impl<slist_impl> bucket_type;
|
||||
typedef 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;
|
||||
@@ -655,7 +735,7 @@ struct bucket_plus_vtraits
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_bucket_pointer() const
|
||||
{ return this->priv_bucket_traits().bucket_begin(); }
|
||||
|
||||
typename slist_impl::size_type priv_bucket_count() const
|
||||
std::size_t priv_bucket_count() const
|
||||
{ return this->priv_bucket_traits().bucket_count(); }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE bucket_ptr priv_invalid_bucket() const
|
||||
@@ -668,9 +748,9 @@ struct bucket_plus_vtraits
|
||||
{ return this->priv_bucket_traits().bucket_begin()->before_begin(); }
|
||||
|
||||
template<class NodeDisposer>
|
||||
static size_type priv_erase_from_single_bucket(bucket_type &b, siterator sbefore_first, siterator slast, NodeDisposer node_disposer, detail::true_) //optimize multikey
|
||||
static std::size_t priv_erase_from_single_bucket(bucket_type &b, siterator sbefore_first, siterator slast, NodeDisposer node_disposer, detail::true_) //optimize multikey
|
||||
{
|
||||
size_type n = 0;
|
||||
std::size_t n = 0;
|
||||
siterator const sfirst(++siterator(sbefore_first));
|
||||
if(sfirst != slast){
|
||||
node_ptr const nf = detail::dcast_bucket_ptr<node>(sfirst.pointed_node());
|
||||
@@ -708,9 +788,9 @@ struct bucket_plus_vtraits
|
||||
}
|
||||
|
||||
template<class NodeDisposer>
|
||||
static size_type priv_erase_from_single_bucket(bucket_type &b, siterator sbefore_first, siterator slast, NodeDisposer node_disposer, detail::false_) //optimize multikey
|
||||
static std::size_t priv_erase_from_single_bucket(bucket_type &b, siterator sbefore_first, siterator slast, NodeDisposer node_disposer, detail::false_) //optimize multikey
|
||||
{
|
||||
size_type n = 0;
|
||||
std::size_t n = 0;
|
||||
siterator it(++siterator(sbefore_first));
|
||||
while(it != slast){
|
||||
node_disposer((it++).pointed_node());
|
||||
@@ -757,17 +837,17 @@ struct bucket_plus_vtraits
|
||||
{ b.erase_after_and_dispose(b.previous(i), node_disposer); }
|
||||
|
||||
template<class NodeDisposer, bool OptimizeMultikey>
|
||||
size_type priv_erase_node_range( siterator const &before_first_it, size_type const first_bucket
|
||||
, siterator const &last_it, size_type const last_bucket
|
||||
std::size_t priv_erase_node_range( siterator const &before_first_it, std::size_t const first_bucket
|
||||
, siterator const &last_it, std::size_t const last_bucket
|
||||
, NodeDisposer node_disposer, detail::bool_<OptimizeMultikey> optimize_multikey_tag)
|
||||
{
|
||||
size_type num_erased(0);
|
||||
std::size_t num_erased(0);
|
||||
siterator last_step_before_it;
|
||||
if(first_bucket != last_bucket){
|
||||
bucket_type *b = (&this->priv_bucket_pointer()[0]);
|
||||
num_erased += this->priv_erase_from_single_bucket
|
||||
(b[first_bucket], before_first_it, b[first_bucket].end(), node_disposer, optimize_multikey_tag);
|
||||
for(size_type i = 0, n = (last_bucket - first_bucket - 1); i != n; ++i){
|
||||
for(std::size_t i = 0, n = (last_bucket - first_bucket - 1); i != n; ++i){
|
||||
num_erased += this->priv_erase_whole_bucket(b[first_bucket+i+1], node_disposer);
|
||||
}
|
||||
last_step_before_it = b[last_bucket].before_begin();
|
||||
@@ -797,9 +877,9 @@ struct bucket_plus_vtraits
|
||||
}
|
||||
|
||||
template<class NodeDisposer>
|
||||
size_type priv_erase_whole_bucket(bucket_type &b, NodeDisposer node_disposer)
|
||||
std::size_t priv_erase_whole_bucket(bucket_type &b, NodeDisposer node_disposer)
|
||||
{
|
||||
size_type num_erased = 0;
|
||||
std::size_t num_erased = 0;
|
||||
siterator b_begin(b.before_begin());
|
||||
siterator nxt(b_begin);
|
||||
++nxt;
|
||||
@@ -841,7 +921,7 @@ struct bucket_plus_vtraits
|
||||
const bucket_type &b = static_cast<const bucket_type&>
|
||||
(bucket_type::slist_type::container_from_end_iterator(bucket_type::s_iterator_to(*bb)));
|
||||
//Now just calculate the index b has in the bucket array
|
||||
return static_cast<size_type>(&b - &*f);
|
||||
return static_cast<std::size_t>(&b - &*f);
|
||||
}
|
||||
|
||||
std::size_t priv_get_bucket_num_no_hash_store(siterator it, detail::false_) //NO optimize multikey
|
||||
@@ -881,10 +961,10 @@ struct bucket_plus_vtraits
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_reference priv_value_from_slist_node(slist_node_ptr n) const
|
||||
{ return *this->priv_value_traits().to_value_ptr(detail::dcast_bucket_ptr<node>(n)); }
|
||||
|
||||
void priv_clear_buckets(const bucket_ptr buckets_ptr, const size_type bucket_cnt)
|
||||
void priv_clear_buckets(const bucket_ptr buckets_ptr, const std::size_t bucket_cnt)
|
||||
{
|
||||
bucket_ptr buckets_it = buckets_ptr;
|
||||
for(size_type bucket_i = 0; bucket_i != bucket_cnt; ++buckets_it, ++bucket_i){
|
||||
for(std::size_t bucket_i = 0; bucket_i != bucket_cnt; ++buckets_it, ++bucket_i){
|
||||
if(safemode_or_autounlink){
|
||||
buckets_it->clear_and_dispose(detail::init_disposer<node_algorithms>());
|
||||
}
|
||||
@@ -909,24 +989,6 @@ struct bucket_plus_vtraits
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_iterator cend() const
|
||||
{ return const_iterator(this->priv_invalid_local_it(), 0); }
|
||||
|
||||
static size_type suggested_upper_bucket_count(size_type n)
|
||||
{
|
||||
const std::size_t *primes = &prime_list_holder<0>::prime_list[0];
|
||||
const std::size_t *primes_end = primes + prime_list_holder<0>::prime_list_size;
|
||||
std::size_t const* bound = std::lower_bound(primes, primes_end, n);
|
||||
bound -= (bound == primes_end);
|
||||
return size_type(*bound);
|
||||
}
|
||||
|
||||
static size_type suggested_lower_bucket_count(size_type n)
|
||||
{
|
||||
const std::size_t *primes = &prime_list_holder<0>::prime_list[0];
|
||||
const std::size_t *primes_end = primes + prime_list_holder<0>::prime_list_size;
|
||||
size_type const* bound = std::upper_bound(primes, primes_end, n);
|
||||
bound -= (bound != primes);
|
||||
return size_type(*bound);
|
||||
}
|
||||
|
||||
//Public functions:
|
||||
struct data_type : public ValueTraits
|
||||
{
|
||||
@@ -1072,9 +1134,8 @@ struct bucket_hash_equal_t
|
||||
typedef typename bucket_hash_type::hasher hasher;
|
||||
typedef BucketTraits bucket_traits;
|
||||
typedef typename bucket_plus_vtraits_t::slist_impl slist_impl;
|
||||
typedef typename slist_impl::size_type size_type;
|
||||
typedef typename slist_impl::iterator siterator;
|
||||
typedef detail::bucket_impl<slist_impl> bucket_type;
|
||||
typedef bucket_impl<slist_impl> bucket_type;
|
||||
typedef typename detail::unordered_bucket_ptr_impl<value_traits>::type bucket_ptr;
|
||||
|
||||
template<class BucketTraitsType>
|
||||
@@ -1089,7 +1150,7 @@ struct bucket_hash_equal_t
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_set_cache(const bucket_ptr &)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE size_type priv_get_cache_bucket_num()
|
||||
BOOST_INTRUSIVE_FORCEINLINE std::size_t priv_get_cache_bucket_num()
|
||||
{ return 0u; }
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_initialize_cache()
|
||||
@@ -1100,8 +1161,8 @@ struct bucket_hash_equal_t
|
||||
|
||||
siterator priv_begin() const
|
||||
{
|
||||
size_type n = 0;
|
||||
size_type bucket_cnt = this->bucket_hash_type::priv_bucket_count();
|
||||
std::size_t n = 0;
|
||||
std::size_t bucket_cnt = this->bucket_hash_type::priv_bucket_count();
|
||||
for (n = 0; n < bucket_cnt; ++n){
|
||||
bucket_type &b = this->bucket_hash_type::priv_bucket_pointer()[n];
|
||||
if(!b.empty()){
|
||||
@@ -1111,10 +1172,10 @@ struct bucket_hash_equal_t
|
||||
return this->bucket_hash_type::priv_invalid_local_it();
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_insertion_update_cache(size_type)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_insertion_update_cache(std::size_t)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_erasure_update_cache_range(size_type, size_type)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_erasure_update_cache_range(std::size_t, std::size_t)
|
||||
{}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE void priv_erasure_update_cache()
|
||||
@@ -1145,7 +1206,6 @@ struct bucket_hash_equal_t<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrK
|
||||
typedef bucket_hash_t<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, BucketTraits> bucket_hash_type;
|
||||
typedef typename bucket_hash_type::hasher hasher;
|
||||
typedef BucketTraits bucket_traits;
|
||||
typedef typename bucket_plus_vtraits_t::slist_impl::size_type size_type;
|
||||
typedef typename bucket_plus_vtraits_t::slist_impl::iterator siterator;
|
||||
|
||||
template<class BucketTraitsType>
|
||||
@@ -1187,7 +1247,7 @@ struct bucket_hash_equal_t<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrK
|
||||
}
|
||||
}
|
||||
|
||||
void priv_insertion_update_cache(size_type insertion_bucket)
|
||||
void priv_insertion_update_cache(std::size_t insertion_bucket)
|
||||
{
|
||||
bucket_ptr p = this->bucket_hash_type::priv_bucket_pointer() + insertion_bucket;
|
||||
if(p < this->cached_begin_){
|
||||
@@ -1201,7 +1261,7 @@ struct bucket_hash_equal_t<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrK
|
||||
BOOST_INTRUSIVE_FORCEINLINE key_equal &priv_equal()
|
||||
{ return this->equal_holder_t::get(); }
|
||||
|
||||
void priv_erasure_update_cache_range(size_type first_bucket_num, size_type last_bucket_num)
|
||||
void priv_erasure_update_cache_range(std::size_t first_bucket_num, std::size_t last_bucket_num)
|
||||
{
|
||||
//If the last bucket is the end, the cache must be updated
|
||||
//to the last position if all
|
||||
@@ -1215,8 +1275,8 @@ struct bucket_hash_equal_t<ValueTraits, VoidOrKeyOfValue, VoidOrKeyHash, VoidOrK
|
||||
void priv_erasure_update_cache()
|
||||
{
|
||||
if(this->cached_begin_ != this->bucket_hash_type::priv_invalid_bucket()){
|
||||
size_type current_n = this->priv_get_cache() - this->bucket_hash_type::priv_bucket_pointer();
|
||||
for( const size_type num_buckets = this->bucket_hash_type::priv_bucket_count()
|
||||
std::size_t current_n = this->priv_get_cache() - this->bucket_hash_type::priv_bucket_pointer();
|
||||
for( const std::size_t num_buckets = this->bucket_hash_type::priv_bucket_count()
|
||||
; current_n < num_buckets
|
||||
; ++current_n, ++this->priv_get_cache()){
|
||||
if(!this->priv_get_cache()->empty()){
|
||||
@@ -1307,7 +1367,7 @@ struct hashdata_internal
|
||||
typedef typename internal_type::key_equal key_equal;
|
||||
typedef typename internal_type::hasher hasher;
|
||||
typedef bucket_plus_vtraits<ValueTraits,BucketTraits> bucket_plus_vtraits_t;
|
||||
typedef typename bucket_plus_vtraits_t::size_type size_type;
|
||||
typedef SizeType size_type;
|
||||
typedef typename internal_type::size_traits split_traits;
|
||||
typedef typename bucket_plus_vtraits_t::bucket_ptr bucket_ptr;
|
||||
typedef typename bucket_plus_vtraits_t::const_value_traits_ptr const_value_traits_ptr;
|
||||
@@ -1323,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
|
||||
typedef typename get_slist_impl
|
||||
<typename 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
|
||||
@@ -1459,7 +1519,11 @@ struct hashdata_internal
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const
|
||||
{ return this->priv_bucket_count(); }
|
||||
{
|
||||
const std::size_t bc = this->priv_bucket_count();
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(sizeof(size_type) >= sizeof(std::size_t) || bc <= size_type(-1));
|
||||
return static_cast<size_type>(bc);
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE size_type bucket_size(size_type n) const
|
||||
{ return this->priv_bucket_pointer()[n].size(); }
|
||||
@@ -1473,6 +1537,16 @@ struct hashdata_internal
|
||||
BOOST_INTRUSIVE_FORCEINLINE const_local_iterator begin(size_type n) const
|
||||
{ return this->cbegin(n); }
|
||||
|
||||
static BOOST_INTRUSIVE_FORCEINLINE size_type suggested_upper_bucket_count(size_type n)
|
||||
{
|
||||
return prime_list_holder<0>::suggested_upper_bucket_count(n);
|
||||
}
|
||||
|
||||
static BOOST_INTRUSIVE_FORCEINLINE size_type suggested_lower_bucket_count(size_type n)
|
||||
{
|
||||
return prime_list_holder<0>::suggested_lower_bucket_count(n);
|
||||
}
|
||||
|
||||
const_local_iterator cbegin(size_type n) const
|
||||
{
|
||||
return const_local_iterator
|
||||
@@ -1482,6 +1556,7 @@ struct hashdata_internal
|
||||
|
||||
using internal_type::end;
|
||||
using internal_type::cend;
|
||||
|
||||
local_iterator end(size_type n)
|
||||
{ return local_iterator(this->priv_bucket_pointer()[n].end(), this->priv_value_traits_ptr()); }
|
||||
|
||||
@@ -1622,7 +1697,7 @@ class hashtable_impl
|
||||
typedef SizeType size_type;
|
||||
typedef typename internal_type::key_equal key_equal;
|
||||
typedef typename internal_type::hasher hasher;
|
||||
typedef detail::bucket_impl<slist_impl> bucket_type;
|
||||
typedef bucket_impl<slist_impl> bucket_type;
|
||||
typedef typename internal_type::bucket_ptr bucket_ptr;
|
||||
typedef typename slist_impl::iterator siterator;
|
||||
typedef typename slist_impl::const_iterator const_siterator;
|
||||
@@ -1665,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;
|
||||
@@ -1737,7 +1812,7 @@ class hashtable_impl
|
||||
{
|
||||
this->priv_initialize_buckets_and_cache();
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
size_type bucket_sz = this->priv_bucket_count();
|
||||
size_type bucket_sz = this->bucket_count();
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(bucket_sz != 0);
|
||||
//Check power of two bucket array if the option is activated
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT
|
||||
@@ -1770,7 +1845,7 @@ class hashtable_impl
|
||||
{
|
||||
this->priv_initialize_buckets_and_cache();
|
||||
this->priv_size_traits().set_size(size_type(0));
|
||||
size_type bucket_sz = this->priv_bucket_count();
|
||||
size_type bucket_sz = this->bucket_count();
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(bucket_sz != 0);
|
||||
//Check power of two bucket array if the option is activated
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT
|
||||
@@ -1783,8 +1858,15 @@ class hashtable_impl
|
||||
this->insert_equal(b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Constructs a container moving resources from another container.
|
||||
//! Internal value traits, bucket traits, hasher and comparison are move constructed and
|
||||
//! nodes belonging to x are linked to *this.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: If value_traits::node_traits::node's
|
||||
//! move constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
||||
//! or the move constructor of value traits, bucket traits, hasher or comparison throws.
|
||||
hashtable_impl(BOOST_RV_REF(hashtable_impl) x)
|
||||
: internal_type( ::boost::move(x.priv_value_traits())
|
||||
, ::boost::move(x.priv_bucket_traits())
|
||||
@@ -1800,7 +1882,7 @@ class hashtable_impl
|
||||
x.priv_split_traits().set_size(size_type(0));
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Equivalent to swap.
|
||||
//!
|
||||
hashtable_impl& operator=(BOOST_RV_REF(hashtable_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
@@ -1894,8 +1976,8 @@ class hashtable_impl
|
||||
return this->begin() == this->end();
|
||||
}
|
||||
else{
|
||||
size_type bucket_cnt = this->priv_bucket_count();
|
||||
const bucket_type *b = boost::intrusive::detail::to_raw_pointer(this->priv_bucket_pointer());
|
||||
size_type bucket_cnt = this->bucket_count();
|
||||
const bucket_type *b = boost::movelib::to_raw_pointer(this->priv_bucket_pointer());
|
||||
for (size_type n = 0; n < bucket_cnt; ++n, ++b){
|
||||
if(!b->empty()){
|
||||
return false;
|
||||
@@ -1917,8 +1999,8 @@ class hashtable_impl
|
||||
return this->priv_size_traits().get_size();
|
||||
else{
|
||||
size_type len = 0;
|
||||
size_type bucket_cnt = this->priv_bucket_count();
|
||||
const bucket_type *b = boost::intrusive::detail::to_raw_pointer(this->priv_bucket_pointer());
|
||||
size_type bucket_cnt = this->bucket_count();
|
||||
const bucket_type *b = boost::movelib::to_raw_pointer(this->priv_bucket_pointer());
|
||||
for (size_type n = 0; n < bucket_cnt; ++n, ++b){
|
||||
len += b->size();
|
||||
}
|
||||
@@ -2898,7 +2980,7 @@ class hashtable_impl
|
||||
//This function is only available for containers with incremental hashing
|
||||
BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
|
||||
const size_type split_idx = this->priv_split_traits().get_size();
|
||||
const size_type bucket_cnt = this->priv_bucket_count();
|
||||
const size_type bucket_cnt = this->bucket_count();
|
||||
const bucket_ptr buck_ptr = this->priv_bucket_pointer();
|
||||
bool ret = false;
|
||||
|
||||
@@ -2961,7 +3043,7 @@ class hashtable_impl
|
||||
//This function is only available for containers with incremental hashing
|
||||
BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
|
||||
size_type const new_bucket_traits_size = new_bucket_traits.bucket_count();
|
||||
size_type const cur_bucket_traits = this->priv_bucket_count();
|
||||
size_type const cur_bucket_traits = this->bucket_count();
|
||||
const size_type split_idx = this->split_count();
|
||||
|
||||
//Test new bucket size is consistent with internal bucket size and split count
|
||||
@@ -3071,7 +3153,7 @@ class hashtable_impl
|
||||
const bucket_ptr new_buckets = new_bucket_traits.bucket_begin();
|
||||
size_type new_bucket_count = new_bucket_traits.bucket_count();
|
||||
const bucket_ptr old_buckets = this->priv_bucket_pointer();
|
||||
size_type old_bucket_count = this->priv_bucket_count();
|
||||
size_type old_bucket_count = this->bucket_count();
|
||||
|
||||
//Check power of two bucket array if the option is activated
|
||||
BOOST_INTRUSIVE_INVARIANT_ASSERT
|
||||
@@ -3348,7 +3430,7 @@ class hashtable_impl
|
||||
, size_type &found_bucket
|
||||
, size_type &cnt) const
|
||||
{
|
||||
cnt = 0;
|
||||
size_type internal_cnt = 0;
|
||||
//Let's see if the element is present
|
||||
|
||||
siterator prev;
|
||||
@@ -3364,20 +3446,21 @@ class hashtable_impl
|
||||
//the same bucket
|
||||
bucket_type &b = this->priv_bucket_pointer()[n_bucket];
|
||||
siterator it = to_return.first;
|
||||
++cnt; //At least one is found
|
||||
++internal_cnt; //At least one is found
|
||||
if(optimize_multikey){
|
||||
to_return.second = ++(priv_last_in_group)(it);
|
||||
cnt += boost::intrusive::iterator_distance(++it, to_return.second);
|
||||
internal_cnt += boost::intrusive::iterator_distance(++it, to_return.second);
|
||||
}
|
||||
else{
|
||||
siterator const bend = b.end();
|
||||
while(++it != bend &&
|
||||
this->priv_is_value_equal_to_key(this->priv_value_from_slist_node(it.pointed_node()), h, key, equal_func)){
|
||||
++cnt;
|
||||
++internal_cnt;
|
||||
}
|
||||
to_return.second = it;
|
||||
}
|
||||
}
|
||||
cnt = internal_cnt;
|
||||
return to_return;
|
||||
}
|
||||
|
||||
@@ -3400,7 +3483,7 @@ class hashtable_impl
|
||||
to_return.second == bp[n_bucket].end()){
|
||||
to_return.second = this->priv_invalid_local_it();
|
||||
++n_bucket;
|
||||
for( const size_type max_bucket = this->priv_bucket_count()
|
||||
for( const size_type max_bucket = this->bucket_count()
|
||||
; n_bucket != max_bucket
|
||||
; ++n_bucket){
|
||||
bucket_type &b = bp[n_bucket];
|
||||
@@ -3432,14 +3515,10 @@ class hashtable_impl
|
||||
};
|
||||
|
||||
/// @cond
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
template < class T
|
||||
, bool UniqueKeys
|
||||
, class PackedOptions
|
||||
>
|
||||
#else
|
||||
template <class T, bool UniqueKeys, class ...Options>
|
||||
#endif
|
||||
struct make_bucket_traits
|
||||
{
|
||||
//Real value traits must be calculated from options
|
||||
@@ -3449,8 +3528,8 @@ struct make_bucket_traits
|
||||
typedef typename PackedOptions::bucket_traits specified_bucket_traits;
|
||||
|
||||
//Real bucket traits must be calculated from options and calculated value_traits
|
||||
typedef typename detail::get_slist_impl
|
||||
<typename detail::reduced_slist_node_traits
|
||||
typedef typename get_slist_impl
|
||||
<typename reduced_slist_node_traits
|
||||
<typename value_traits::node_traits>::type
|
||||
>::type slist_impl;
|
||||
|
||||
@@ -3459,7 +3538,7 @@ struct make_bucket_traits
|
||||
< specified_bucket_traits
|
||||
, default_bucket_traits
|
||||
>::value
|
||||
, detail::bucket_traits_impl<slist_impl>
|
||||
, bucket_traits_impl<slist_impl>
|
||||
, specified_bucket_traits
|
||||
>::type type;
|
||||
};
|
||||
|
||||
@@ -384,6 +384,7 @@ template
|
||||
, class O4 = void
|
||||
, class O5 = void
|
||||
, class O6 = void
|
||||
, class O7 = void
|
||||
>
|
||||
#else
|
||||
template<class T, class ...Options>
|
||||
@@ -399,6 +400,7 @@ template
|
||||
, class O4 = void
|
||||
, class O5 = void
|
||||
, class O6 = void
|
||||
, class O7 = void
|
||||
>
|
||||
#else
|
||||
template<class T, class ...Options>
|
||||
@@ -414,6 +416,7 @@ template
|
||||
, class O4 = void
|
||||
, class O5 = void
|
||||
, class O6 = void
|
||||
, class O7 = void
|
||||
>
|
||||
#else
|
||||
template<class T, class ...Options>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -215,8 +215,15 @@ class list_impl
|
||||
this->insert(this->cend(), b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Constructs a container moving resources from another container.
|
||||
//! Internal value traits are move constructed and
|
||||
//! nodes belonging to x (except the node representing the "end") are linked to *this.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: If value_traits::node_traits::node's
|
||||
//! move constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
||||
//! or the move constructor of value traits throws.
|
||||
list_impl(BOOST_RV_REF(list_impl) x)
|
||||
: data_(::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
@@ -226,7 +233,7 @@ class list_impl
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Equivalent to swap
|
||||
//!
|
||||
list_impl& operator=(BOOST_RV_REF(list_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
@@ -1464,38 +1471,38 @@ class list
|
||||
typedef typename Base::iterator iterator;
|
||||
typedef typename Base::const_iterator const_iterator;
|
||||
|
||||
list()
|
||||
BOOST_INTRUSIVE_FORCEINLINE list()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit list(const value_traits &v_traits)
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit list(const value_traits &v_traits)
|
||||
: Base(v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
list(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE list(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, v_traits)
|
||||
{}
|
||||
|
||||
list(BOOST_RV_REF(list) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE list(BOOST_RV_REF(list) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
list& operator=(BOOST_RV_REF(list) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE list& operator=(BOOST_RV_REF(list) x)
|
||||
{ return static_cast<list &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const list &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const list &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(list) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(list) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static list &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static list &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<list &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const list &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const list &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const list &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/intrusive/detail/parent_from_member.hpp>
|
||||
#include <boost/intrusive/detail/to_raw_pointer.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
@@ -66,13 +66,13 @@ struct member_value_traits
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr &n)
|
||||
{
|
||||
return pointer_traits<pointer>::pointer_to(*detail::parent_from_member<value_type, node>
|
||||
(boost::intrusive::detail::to_raw_pointer(n), PtrToMember));
|
||||
(boost::movelib::to_raw_pointer(n), PtrToMember));
|
||||
}
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr &n)
|
||||
{
|
||||
return pointer_traits<const_pointer>::pointer_to(*detail::parent_from_member<value_type, node>
|
||||
(boost::intrusive::detail::to_raw_pointer(n), PtrToMember));
|
||||
(boost::movelib::to_raw_pointer(n), PtrToMember));
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/intrusive/pack_options.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
|
||||
#if defined(BOOST_HAS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
@@ -70,6 +69,15 @@ BOOST_INTRUSIVE_OPTION_TYPE(compare, Compare, Compare, compare)
|
||||
//!that will return the key from a value_type of an associative container
|
||||
BOOST_INTRUSIVE_OPTION_TYPE(key_of_value, KeyOfValue, KeyOfValue, key_of_value)
|
||||
|
||||
//!This option setter specifies a function object
|
||||
//!that specifies the type of the priority of a treap
|
||||
//!container and an operator to obtain it from a value type.
|
||||
//!
|
||||
//!This function object must the define a `type` member typedef and
|
||||
//!a member with signature `type [const&] operator()(const value_type &) const`
|
||||
//!that will return the priority from a value_type of a treap container
|
||||
BOOST_INTRUSIVE_OPTION_TYPE(priority_of_value, PrioOfValue, PrioOfValue, priority_of_value)
|
||||
|
||||
//!This option setter for scapegoat containers specifies if
|
||||
//!the intrusive scapegoat container should use a non-variable
|
||||
//!alpha value that does not need floating-point operations.
|
||||
|
||||
@@ -22,6 +22,20 @@
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
|
||||
//GCC reports uninitialized values when an uninitialized pointer plus bits type
|
||||
//is asigned some bits or some pointer value, but that's ok, because we don't want
|
||||
//to default initialize parts that are not being updated.
|
||||
#if defined(BOOST_GCC)
|
||||
# if (BOOST_GCC >= 40600)
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
# if (BOOST_GCC >= 40700)
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
@@ -89,6 +103,10 @@ struct pointer_plus_bits<T*, NumBits>
|
||||
} //namespace intrusive
|
||||
} //namespace boost
|
||||
|
||||
#if defined(BOOST_GCC) && (BOOST_GCC >= 40600)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#include <boost/intrusive/detail/config_end.hpp>
|
||||
|
||||
#endif //BOOST_INTRUSIVE_POINTER_PLUS_BITS_HPP
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/detail/workaround.hpp>
|
||||
#include <boost/intrusive/pointer_rebind.hpp>
|
||||
#include <boost/intrusive/detail/pointer_element.hpp>
|
||||
#include <boost/move/detail/pointer_element.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
@@ -97,7 +97,7 @@ struct pointer_traits
|
||||
//
|
||||
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT
|
||||
( boost::intrusive::detail::, Ptr, element_type
|
||||
, boost::intrusive::detail::first_param<Ptr>) element_type;
|
||||
, boost::movelib::detail::first_param<Ptr>) element_type;
|
||||
//
|
||||
typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT
|
||||
(boost::intrusive::detail::, Ptr, difference_type, std::ptrdiff_t) difference_type;
|
||||
@@ -123,7 +123,7 @@ struct pointer_traits
|
||||
//!
|
||||
//! <b>Note</b>: For non-conforming compilers only the existence of a member function called
|
||||
//! <code>pointer_to</code> is checked.
|
||||
static pointer pointer_to(reference r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r)
|
||||
{
|
||||
//Non-standard extension, it does not require Ptr::pointer_to. If not present
|
||||
//tries to converts &r to pointer.
|
||||
@@ -143,7 +143,7 @@ struct pointer_traits
|
||||
//! <b>Note</b>: For non-conforming compilers only the existence of a member function called
|
||||
//! <code>static_cast_from</code> is checked.
|
||||
template<class UPtr>
|
||||
static pointer static_cast_from(const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(const UPtr &uptr)
|
||||
{
|
||||
typedef const UPtr &RefArg;
|
||||
const bool value = boost::intrusive::detail::
|
||||
@@ -164,7 +164,7 @@ struct pointer_traits
|
||||
//! <b>Note</b>: For non-conforming compilers only the existence of a member function called
|
||||
//! <code>const_cast_from</code> is checked.
|
||||
template<class UPtr>
|
||||
static pointer const_cast_from(const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(const UPtr &uptr)
|
||||
{
|
||||
typedef const UPtr &RefArg;
|
||||
const bool value = boost::intrusive::detail::
|
||||
@@ -185,7 +185,7 @@ struct pointer_traits
|
||||
//! <b>Note</b>: For non-conforming compilers only the existence of a member function called
|
||||
//! <code>dynamic_cast_from</code> is checked.
|
||||
template<class UPtr>
|
||||
static pointer dynamic_cast_from(const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(const UPtr &uptr)
|
||||
{
|
||||
typedef const UPtr &RefArg;
|
||||
const bool value = boost::intrusive::detail::
|
||||
@@ -201,46 +201,46 @@ struct pointer_traits
|
||||
private:
|
||||
//priv_to_raw_pointer
|
||||
template <class T>
|
||||
static T* to_raw_pointer(T* p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static T* to_raw_pointer(T* p)
|
||||
{ return p; }
|
||||
|
||||
template <class Pointer>
|
||||
static typename pointer_traits<Pointer>::element_type*
|
||||
BOOST_INTRUSIVE_FORCEINLINE static typename pointer_traits<Pointer>::element_type*
|
||||
to_raw_pointer(const Pointer &p)
|
||||
{ return pointer_traits::to_raw_pointer(p.operator->()); }
|
||||
|
||||
//priv_pointer_to
|
||||
static pointer priv_pointer_to(boost::intrusive::detail::true_, reference r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_pointer_to(boost::intrusive::detail::true_, reference r)
|
||||
{ return Ptr::pointer_to(r); }
|
||||
|
||||
static pointer priv_pointer_to(boost::intrusive::detail::false_, reference r)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_pointer_to(boost::intrusive::detail::false_, reference r)
|
||||
{ return pointer(boost::intrusive::detail::addressof(r)); }
|
||||
|
||||
//priv_static_cast_from
|
||||
template<class UPtr>
|
||||
static pointer priv_static_cast_from(boost::intrusive::detail::true_, const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_static_cast_from(boost::intrusive::detail::true_, const UPtr &uptr)
|
||||
{ return Ptr::static_cast_from(uptr); }
|
||||
|
||||
template<class UPtr>
|
||||
static pointer priv_static_cast_from(boost::intrusive::detail::false_, const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_static_cast_from(boost::intrusive::detail::false_, const UPtr &uptr)
|
||||
{ return uptr ? pointer_to(*static_cast<element_type*>(to_raw_pointer(uptr))) : pointer(); }
|
||||
|
||||
//priv_const_cast_from
|
||||
template<class UPtr>
|
||||
static pointer priv_const_cast_from(boost::intrusive::detail::true_, const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_const_cast_from(boost::intrusive::detail::true_, const UPtr &uptr)
|
||||
{ return Ptr::const_cast_from(uptr); }
|
||||
|
||||
template<class UPtr>
|
||||
static pointer priv_const_cast_from(boost::intrusive::detail::false_, const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_const_cast_from(boost::intrusive::detail::false_, const UPtr &uptr)
|
||||
{ return uptr ? pointer_to(const_cast<element_type&>(*uptr)) : pointer(); }
|
||||
|
||||
//priv_dynamic_cast_from
|
||||
template<class UPtr>
|
||||
static pointer priv_dynamic_cast_from(boost::intrusive::detail::true_, const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_dynamic_cast_from(boost::intrusive::detail::true_, const UPtr &uptr)
|
||||
{ return Ptr::dynamic_cast_from(uptr); }
|
||||
|
||||
template<class UPtr>
|
||||
static pointer priv_dynamic_cast_from(boost::intrusive::detail::false_, const UPtr &uptr)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer priv_dynamic_cast_from(boost::intrusive::detail::false_, const UPtr &uptr)
|
||||
{ return uptr ? pointer_to(dynamic_cast<element_type&>(*uptr)) : pointer(); }
|
||||
///@endcond
|
||||
};
|
||||
|
||||
@@ -60,14 +60,14 @@ struct priority_compare<void>
|
||||
/// @cond
|
||||
|
||||
template<class PrioComp, class T>
|
||||
struct get_prio
|
||||
struct get_prio_comp
|
||||
{
|
||||
typedef PrioComp type;
|
||||
};
|
||||
|
||||
|
||||
template<class T>
|
||||
struct get_prio<void, T>
|
||||
struct get_prio_comp<void, T>
|
||||
{
|
||||
typedef ::boost::intrusive::priority_compare<T> type;
|
||||
};
|
||||
|
||||
@@ -538,46 +538,46 @@ class rbtree
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
rbtree()
|
||||
BOOST_INTRUSIVE_FORCEINLINE rbtree()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit rbtree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit rbtree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
rbtree( bool unique, Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE rbtree( bool unique, Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
rbtree(BOOST_RV_REF(rbtree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE rbtree(BOOST_RV_REF(rbtree) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
rbtree& operator=(BOOST_RV_REF(rbtree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE rbtree& operator=(BOOST_RV_REF(rbtree) x)
|
||||
{ return static_cast<rbtree &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const rbtree &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const rbtree &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(rbtree) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(rbtree) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static rbtree &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static rbtree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<rbtree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const rbtree &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const rbtree &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const rbtree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static rbtree &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static rbtree &container_from_iterator(iterator it)
|
||||
{ return static_cast<rbtree &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const rbtree &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const rbtree &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const rbtree &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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){
|
||||
|
||||
@@ -525,46 +525,46 @@ class set
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
set()
|
||||
BOOST_INTRUSIVE_FORCEINLINE set()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
set( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE set( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
set(BOOST_RV_REF(set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE set(BOOST_RV_REF(set) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
set& operator=(BOOST_RV_REF(set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE set& operator=(BOOST_RV_REF(set) x)
|
||||
{ return static_cast<set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const set &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const set &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(set) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(set) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static set &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const set &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static set &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static set &container_from_iterator(iterator it)
|
||||
{ return static_cast<set &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const set &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const set &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const set &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
@@ -1020,46 +1020,46 @@ class multiset
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
multiset()
|
||||
BOOST_INTRUSIVE_FORCEINLINE multiset()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
multiset( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE multiset( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
multiset(BOOST_RV_REF(multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE multiset(BOOST_RV_REF(multiset) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
multiset& operator=(BOOST_RV_REF(multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE multiset& operator=(BOOST_RV_REF(multiset) x)
|
||||
{ return static_cast<multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const multiset &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const multiset &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(multiset) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(multiset) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static multiset &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static multiset &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static multiset &container_from_iterator(iterator it)
|
||||
{ return static_cast<multiset &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const multiset &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const multiset &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const multiset &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -534,46 +534,46 @@ class sg_set
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
sg_set()
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_set()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit sg_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit sg_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
sg_set( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_set( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
sg_set(BOOST_RV_REF(sg_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_set(BOOST_RV_REF(sg_set) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
sg_set& operator=(BOOST_RV_REF(sg_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_set& operator=(BOOST_RV_REF(sg_set) x)
|
||||
{ return static_cast<sg_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const sg_set &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const sg_set &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(sg_set) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(sg_set) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static sg_set &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static sg_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<sg_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const sg_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const sg_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const sg_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static sg_set &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static sg_set &container_from_iterator(iterator it)
|
||||
{ return static_cast<sg_set &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const sg_set &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const sg_set &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const sg_set &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
@@ -1041,46 +1041,46 @@ class sg_multiset
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
sg_multiset()
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_multiset()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit sg_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit sg_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
sg_multiset( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_multiset( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
sg_multiset(BOOST_RV_REF(sg_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_multiset(BOOST_RV_REF(sg_multiset) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
sg_multiset& operator=(BOOST_RV_REF(sg_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE sg_multiset& operator=(BOOST_RV_REF(sg_multiset) x)
|
||||
{ return static_cast<sg_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const sg_multiset &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const sg_multiset &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(sg_multiset) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(sg_multiset) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static sg_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static sg_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const sg_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const sg_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static sg_multiset &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static sg_multiset &container_from_iterator(iterator it)
|
||||
{ return static_cast<sg_multiset &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const sg_multiset &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const sg_multiset &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const sg_multiset &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -1028,46 +1028,46 @@ class sgtree
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
sgtree()
|
||||
BOOST_INTRUSIVE_FORCEINLINE sgtree()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit sgtree(const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit sgtree(const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
sgtree( bool unique, Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE sgtree( bool unique, Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
sgtree(BOOST_RV_REF(sgtree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE sgtree(BOOST_RV_REF(sgtree) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
sgtree& operator=(BOOST_RV_REF(sgtree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE sgtree& operator=(BOOST_RV_REF(sgtree) x)
|
||||
{ return static_cast<sgtree &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const sgtree &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const sgtree &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(sgtree) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(sgtree) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static sgtree &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static sgtree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<sgtree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const sgtree &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const sgtree &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const sgtree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static sgtree &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static sgtree &container_from_iterator(iterator it)
|
||||
{ return static_cast<sgtree &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const sgtree &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const sgtree &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const sgtree &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -233,7 +233,7 @@ class slist_impl
|
||||
{};
|
||||
|
||||
struct data_t
|
||||
: public slist_impl::value_traits
|
||||
: public value_traits
|
||||
{
|
||||
typedef typename slist_impl::value_traits value_traits;
|
||||
explicit data_t(const value_traits &val_traits)
|
||||
@@ -338,8 +338,15 @@ class slist_impl
|
||||
this->insert_after(this->cbefore_begin(), b, e);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Constructs a container moving resources from another container.
|
||||
//! Internal value traits are move constructed and
|
||||
//! nodes belonging to x (except the node representing the "end") are linked to *this.
|
||||
//!
|
||||
//! <b>Complexity</b>: Constant.
|
||||
//!
|
||||
//! <b>Throws</b>: If value_traits::node_traits::node's
|
||||
//! move constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
||||
//! or the move constructor of value traits throws.
|
||||
slist_impl(BOOST_RV_REF(slist_impl) x)
|
||||
: data_(::boost::move(x.priv_value_traits()))
|
||||
{
|
||||
@@ -348,7 +355,7 @@ class slist_impl
|
||||
this->swap(x);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: to-do
|
||||
//! <b>Effects</b>: Equivalent to swap
|
||||
//!
|
||||
slist_impl& operator=(BOOST_RV_REF(slist_impl) x)
|
||||
{ this->swap(x); return *this; }
|
||||
@@ -1988,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()){
|
||||
@@ -2001,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()){
|
||||
@@ -2101,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)
|
||||
@@ -2195,45 +2202,45 @@ class slist
|
||||
typedef typename Base::size_type size_type;
|
||||
typedef typename Base::node_ptr node_ptr;
|
||||
|
||||
slist()
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit slist(const value_traits &v_traits)
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit slist(const value_traits &v_traits)
|
||||
: Base(v_traits)
|
||||
{}
|
||||
|
||||
struct incorporate_t{};
|
||||
|
||||
slist( const node_ptr & f, const node_ptr & before_l
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist( const node_ptr & f, const node_ptr & before_l
|
||||
, size_type n, const value_traits &v_traits = value_traits())
|
||||
: Base(f, before_l, n, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
slist(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, v_traits)
|
||||
{}
|
||||
|
||||
slist(BOOST_RV_REF(slist) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist(BOOST_RV_REF(slist) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
slist& operator=(BOOST_RV_REF(slist) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE slist& operator=(BOOST_RV_REF(slist) x)
|
||||
{ return static_cast<slist &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const slist &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const slist &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(slist) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(slist) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static slist &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static slist &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<slist &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const slist &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const slist &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const slist &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -546,46 +546,46 @@ class splay_set
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
splay_set()
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_set()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit splay_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit splay_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
splay_set( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_set( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
splay_set(BOOST_RV_REF(splay_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_set(BOOST_RV_REF(splay_set) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
splay_set& operator=(BOOST_RV_REF(splay_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_set& operator=(BOOST_RV_REF(splay_set) x)
|
||||
{ return static_cast<splay_set &>(this->Base::operator=(::boost::move(static_cast<Base&>(x)))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const splay_set &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const splay_set &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(splay_set) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(splay_set) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static splay_set &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static splay_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<splay_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const splay_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const splay_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const splay_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static splay_set &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static splay_set &container_from_iterator(iterator it)
|
||||
{ return static_cast<splay_set &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const splay_set &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const splay_set &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const splay_set &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
@@ -1057,46 +1057,46 @@ class splay_multiset
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
splay_multiset()
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_multiset()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit splay_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit splay_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
splay_multiset( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_multiset( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
splay_multiset(BOOST_RV_REF(splay_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_multiset(BOOST_RV_REF(splay_multiset) x)
|
||||
: Base(::boost::move(static_cast<Base&>(x)))
|
||||
{}
|
||||
|
||||
splay_multiset& operator=(BOOST_RV_REF(splay_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE splay_multiset& operator=(BOOST_RV_REF(splay_multiset) x)
|
||||
{ return static_cast<splay_multiset &>(this->Base::operator=(::boost::move(static_cast<Base&>(x)))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const splay_multiset &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const splay_multiset &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(splay_multiset) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(splay_multiset) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static splay_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static splay_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<splay_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const splay_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const splay_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const splay_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static splay_multiset &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static splay_multiset &container_from_iterator(iterator it)
|
||||
{ return static_cast<splay_multiset &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const splay_multiset &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const splay_multiset &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const splay_multiset &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -613,46 +613,46 @@ class splaytree
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
splaytree()
|
||||
BOOST_INTRUSIVE_FORCEINLINE splaytree()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit splaytree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit splaytree( const key_compare &cmp, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
splaytree( bool unique, Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE splaytree( bool unique, Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(unique, b, e, cmp, v_traits)
|
||||
{}
|
||||
|
||||
splaytree(BOOST_RV_REF(splaytree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE splaytree(BOOST_RV_REF(splaytree) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
splaytree& operator=(BOOST_RV_REF(splaytree) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE splaytree& operator=(BOOST_RV_REF(splaytree) x)
|
||||
{ return static_cast<splaytree &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const splaytree &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const splaytree &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(splaytree) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(splaytree) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static splaytree &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static splaytree &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<splaytree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const splaytree &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const splaytree &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const splaytree &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static splaytree &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static splaytree &container_from_iterator(iterator it)
|
||||
{ return static_cast<splaytree &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const splaytree &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const splaytree &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const splaytree &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -50,8 +50,24 @@ struct treap_defaults
|
||||
: bstree_defaults
|
||||
{
|
||||
typedef void priority;
|
||||
typedef void priority_of_value;
|
||||
};
|
||||
|
||||
template<class ValuePtr, class VoidOrPrioOfValue, class VoidOrPrioComp>
|
||||
struct treap_prio_types
|
||||
{
|
||||
typedef typename
|
||||
boost::movelib::pointer_element<ValuePtr>::type value_type;
|
||||
typedef typename get_key_of_value
|
||||
< VoidOrPrioOfValue, value_type>::type priority_of_value;
|
||||
typedef typename priority_of_value::type priority_type;
|
||||
typedef typename get_prio_comp< VoidOrPrioComp
|
||||
, priority_type
|
||||
>::type priority_compare;
|
||||
};
|
||||
|
||||
struct treap_tag;
|
||||
|
||||
/// @endcond
|
||||
|
||||
//! The class template treap is an intrusive treap container that
|
||||
@@ -70,18 +86,15 @@ struct treap_defaults
|
||||
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
||||
template<class T, class ...Options>
|
||||
#else
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioOfValue, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
#endif
|
||||
class treap_impl
|
||||
/// @cond
|
||||
: public bstree_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>
|
||||
//Use public inheritance to avoid MSVC bugs with closures
|
||||
, public detail::ebo_functor_holder
|
||||
< typename get_prio
|
||||
< VoidOrPrioComp
|
||||
, typename bstree_impl
|
||||
<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>::key_type>::type
|
||||
>
|
||||
< typename treap_prio_types<typename ValueTraits::pointer, VoidOrPrioOfValue, VoidOrPrioComp>::priority_compare
|
||||
, treap_tag>
|
||||
/// @endcond
|
||||
{
|
||||
public:
|
||||
@@ -91,12 +104,12 @@ class treap_impl
|
||||
, ConstantTimeSize, BsTreeAlgorithms
|
||||
, HeaderHolder> tree_type;
|
||||
typedef tree_type implementation_defined;
|
||||
typedef get_prio
|
||||
< VoidOrPrioComp
|
||||
, typename tree_type::key_type> get_prio_type;
|
||||
typedef treap_prio_types
|
||||
< typename ValueTraits::pointer
|
||||
, VoidOrPrioOfValue, VoidOrPrioComp> treap_prio_types_t;
|
||||
|
||||
typedef detail::ebo_functor_holder
|
||||
<typename get_prio_type::type> prio_base;
|
||||
<typename treap_prio_types_t::priority_compare, treap_tag> prio_base;
|
||||
|
||||
/// @endcond
|
||||
|
||||
@@ -120,17 +133,22 @@ class treap_impl
|
||||
typedef typename implementation_defined::node_ptr node_ptr;
|
||||
typedef typename implementation_defined::const_node_ptr const_node_ptr;
|
||||
typedef BOOST_INTRUSIVE_IMPDEF(treap_algorithms<node_traits>) node_algorithms;
|
||||
typedef BOOST_INTRUSIVE_IMPDEF(typename get_prio_type::type) priority_compare;
|
||||
typedef BOOST_INTRUSIVE_IMPDEF
|
||||
(typename treap_prio_types_t::priority_type) priority_type;
|
||||
typedef BOOST_INTRUSIVE_IMPDEF
|
||||
(typename treap_prio_types_t::priority_of_value) priority_of_value;
|
||||
typedef BOOST_INTRUSIVE_IMPDEF
|
||||
(typename treap_prio_types_t::priority_compare) priority_compare;
|
||||
|
||||
static const bool constant_time_size = implementation_defined::constant_time_size;
|
||||
static const bool stateful_value_traits = implementation_defined::stateful_value_traits;
|
||||
static const bool safemode_or_autounlink = is_safe_autounlink<value_traits::link_mode>::value;
|
||||
|
||||
typedef detail::key_nodeptr_comp<priority_compare, value_traits, key_of_value> key_node_prio_comp_t;
|
||||
typedef detail::key_nodeptr_comp<priority_compare, value_traits, priority_of_value> prio_node_prio_comp_t;
|
||||
|
||||
template<class KeyPrioComp>
|
||||
detail::key_nodeptr_comp<KeyPrioComp, value_traits, key_of_value> key_node_prio_comp(KeyPrioComp keypriocomp) const
|
||||
{ return detail::key_nodeptr_comp<KeyPrioComp, value_traits, key_of_value>(keypriocomp, &this->get_value_traits()); }
|
||||
template<class PrioPrioComp>
|
||||
detail::key_nodeptr_comp<PrioPrioComp, value_traits, priority_of_value> prio_node_prio_comp(PrioPrioComp priopriocomp) const
|
||||
{ return detail::key_nodeptr_comp<PrioPrioComp, value_traits, priority_of_value>(priopriocomp, &this->get_value_traits()); }
|
||||
|
||||
/// @cond
|
||||
private:
|
||||
@@ -157,7 +175,7 @@ class treap_impl
|
||||
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
|
||||
//! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee.
|
||||
treap_impl()
|
||||
: tree_type(), prio_base(priority_compare())
|
||||
: tree_type(), prio_base()
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: Constructs an empty container.
|
||||
@@ -421,7 +439,7 @@ class treap_impl
|
||||
( this->tree_type::header_ptr()
|
||||
, to_insert
|
||||
, this->key_node_comp(this->key_comp())
|
||||
, this->key_node_prio_comp(this->priv_pcomp()))
|
||||
, this->prio_node_prio_comp(this->priv_pcomp()))
|
||||
, this->priv_value_traits_ptr());
|
||||
this->tree_type::sz_traits().increment();
|
||||
return ret;
|
||||
@@ -451,7 +469,7 @@ class treap_impl
|
||||
, hint.pointed_node()
|
||||
, to_insert
|
||||
, this->key_node_comp(this->key_comp())
|
||||
, this->key_node_prio_comp(this->priv_pcomp()))
|
||||
, this->prio_node_prio_comp(this->priv_pcomp()))
|
||||
, this->priv_value_traits_ptr());
|
||||
this->tree_type::sz_traits().increment();
|
||||
return ret;
|
||||
@@ -496,7 +514,7 @@ class treap_impl
|
||||
std::pair<iterator, bool> insert_unique(reference value)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
std::pair<iterator, bool> ret = this->insert_unique_check(key_of_value()(value), commit_data);
|
||||
std::pair<iterator, bool> ret = this->insert_unique_check(key_of_value()(value), priority_of_value()(value), commit_data);
|
||||
if(!ret.second)
|
||||
return ret;
|
||||
return std::pair<iterator, bool> (this->insert_unique_commit(value, commit_data), true);
|
||||
@@ -520,7 +538,7 @@ class treap_impl
|
||||
iterator insert_unique(const_iterator hint, reference value)
|
||||
{
|
||||
insert_commit_data commit_data;
|
||||
std::pair<iterator, bool> ret = this->insert_unique_check(hint, key_of_value()(value), commit_data);
|
||||
std::pair<iterator, bool> ret = this->insert_unique_check(hint, key_of_value()(value), priority_of_value()(value), commit_data);
|
||||
if(!ret.second)
|
||||
return ret.first;
|
||||
return this->insert_unique_commit(value, commit_data);
|
||||
@@ -581,8 +599,8 @@ class treap_impl
|
||||
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
|
||||
//! objects are inserted or erased from the container.
|
||||
std::pair<iterator, bool> insert_unique_check
|
||||
( const key_type &key, insert_commit_data &commit_data)
|
||||
{ return this->insert_unique_check(key, this->key_comp(), this->priv_pcomp(), commit_data); }
|
||||
( const key_type &key, const priority_type &prio, insert_commit_data &commit_data)
|
||||
{ return this->insert_unique_check(key, this->key_comp(), prio, this->priv_pcomp(), commit_data); }
|
||||
|
||||
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
|
||||
//! a user provided key instead of the value itself, using "hint"
|
||||
@@ -613,14 +631,14 @@ class treap_impl
|
||||
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
|
||||
//! objects are inserted or erased from the container.
|
||||
std::pair<iterator, bool> insert_unique_check
|
||||
( const_iterator hint, const key_type &key, insert_commit_data &commit_data)
|
||||
{ return this->insert_unique_check(hint, key, this->key_comp(), this->priv_pcomp(), commit_data); }
|
||||
( const_iterator hint, const key_type &key, const priority_type &prio, insert_commit_data &commit_data)
|
||||
{ return this->insert_unique_check(hint, key, this->key_comp(), prio, this->priv_pcomp(), commit_data); }
|
||||
|
||||
//! <b>Requires</b>: comp must be a comparison function that induces
|
||||
//! the same strict weak ordering as key_compare.
|
||||
//! key_value_pcomp must be a comparison function that induces
|
||||
//! prio_value_pcomp must be a comparison function that induces
|
||||
//! the same strict weak ordering as priority_compare. The difference is that
|
||||
//! key_value_pcomp and comp compare an arbitrary key with the contained values.
|
||||
//! prio_value_pcomp and comp compare an arbitrary key/priority with the contained values.
|
||||
//!
|
||||
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
|
||||
//! a user provided key instead of the value itself.
|
||||
@@ -633,7 +651,7 @@ class treap_impl
|
||||
//!
|
||||
//! <b>Complexity</b>: Average complexity is at most logarithmic.
|
||||
//!
|
||||
//! <b>Throws</b>: If the comp or key_value_pcomp
|
||||
//! <b>Throws</b>: If the comp or prio_value_pcomp
|
||||
//! ordering functions throw. Strong guarantee.
|
||||
//!
|
||||
//! <b>Notes</b>: This function is used to improve performance when constructing
|
||||
@@ -649,27 +667,29 @@ class treap_impl
|
||||
//!
|
||||
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
|
||||
//! objects are inserted or erased from the container.
|
||||
template<class KeyType, class KeyTypeKeyCompare, class KeyValuePrioCompare>
|
||||
template<class KeyType, class KeyTypeKeyCompare, class PrioType, class PrioValuePrioCompare>
|
||||
BOOST_INTRUSIVE_DOC1ST(std::pair<iterator BOOST_INTRUSIVE_I bool>
|
||||
, typename detail::disable_if_convertible
|
||||
<KeyType BOOST_INTRUSIVE_I const_iterator BOOST_INTRUSIVE_I
|
||||
std::pair<iterator BOOST_INTRUSIVE_I bool> >::type)
|
||||
insert_unique_check
|
||||
( const KeyType &key, KeyTypeKeyCompare comp
|
||||
, KeyValuePrioCompare key_value_pcomp, insert_commit_data &commit_data)
|
||||
, const PrioType &prio, PrioValuePrioCompare prio_value_pcomp, insert_commit_data &commit_data)
|
||||
{
|
||||
std::pair<node_ptr, bool> const ret =
|
||||
(node_algorithms::insert_unique_check
|
||||
( this->tree_type::header_ptr(), key
|
||||
, this->key_node_comp(comp), this->key_node_prio_comp(key_value_pcomp), commit_data));
|
||||
( this->tree_type::header_ptr()
|
||||
, key, this->key_node_comp(comp)
|
||||
, prio, this->prio_node_prio_comp(prio_value_pcomp)
|
||||
, commit_data));
|
||||
return std::pair<iterator, bool>(iterator(ret.first, this->priv_value_traits_ptr()), ret.second);
|
||||
}
|
||||
|
||||
//! <b>Requires</b>: comp must be a comparison function that induces
|
||||
//! the same strict weak ordering as key_compare.
|
||||
//! key_value_pcomp must be a comparison function that induces
|
||||
//! prio_value_pcomp must be a comparison function that induces
|
||||
//! the same strict weak ordering as priority_compare. The difference is that
|
||||
//! key_value_pcomp and comp compare an arbitrary key with the contained values.
|
||||
//! prio_value_pcomp and comp compare an arbitrary key/priority with the contained values.
|
||||
//!
|
||||
//! <b>Effects</b>: Checks if a value can be inserted in the container, using
|
||||
//! a user provided key instead of the value itself, using "hint"
|
||||
@@ -684,7 +704,7 @@ class treap_impl
|
||||
//! <b>Complexity</b>: Logarithmic in general, but it's amortized
|
||||
//! constant time if t is inserted immediately before hint.
|
||||
//!
|
||||
//! <b>Throws</b>: If the comp or key_value_pcomp
|
||||
//! <b>Throws</b>: If the comp or prio_value_pcomp
|
||||
//! ordering functions throw. Strong guarantee.
|
||||
//!
|
||||
//! <b>Notes</b>: This function is used to improve performance when constructing
|
||||
@@ -700,17 +720,21 @@ class treap_impl
|
||||
//!
|
||||
//! "commit_data" remains valid for a subsequent "insert_commit" only if no more
|
||||
//! objects are inserted or erased from the container.
|
||||
template<class KeyType, class KeyTypeKeyCompare, class KeyValuePrioCompare>
|
||||
template<class KeyType, class KeyTypeKeyCompare, class PrioType, class PrioValuePrioCompare>
|
||||
std::pair<iterator, bool> insert_unique_check
|
||||
( const_iterator hint, const KeyType &key
|
||||
( const_iterator hint
|
||||
, const KeyType &key
|
||||
, KeyTypeKeyCompare comp
|
||||
, KeyValuePrioCompare key_value_pcomp
|
||||
, const PrioType &prio
|
||||
, PrioValuePrioCompare prio_value_pcomp
|
||||
, insert_commit_data &commit_data)
|
||||
{
|
||||
std::pair<node_ptr, bool> const ret =
|
||||
(node_algorithms::insert_unique_check
|
||||
( this->tree_type::header_ptr(), hint.pointed_node(), key
|
||||
, this->key_node_comp(comp), this->key_node_prio_comp(key_value_pcomp), commit_data));
|
||||
( this->tree_type::header_ptr(), hint.pointed_node()
|
||||
, key, this->key_node_comp(comp)
|
||||
, prio, this->prio_node_prio_comp(prio_value_pcomp)
|
||||
, commit_data));
|
||||
return std::pair<iterator, bool>(iterator(ret.first, this->priv_value_traits_ptr()), ret.second);
|
||||
}
|
||||
|
||||
@@ -763,7 +787,7 @@ class treap_impl
|
||||
( this->tree_type::header_ptr()
|
||||
, pos.pointed_node()
|
||||
, to_insert
|
||||
, this->key_node_prio_comp(this->priv_pcomp())
|
||||
, this->prio_node_prio_comp(this->priv_pcomp())
|
||||
)
|
||||
, this->priv_value_traits_ptr());
|
||||
this->tree_type::sz_traits().increment();
|
||||
@@ -789,7 +813,7 @@ class treap_impl
|
||||
node_ptr to_insert(this->get_value_traits().to_node_ptr(value));
|
||||
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert));
|
||||
node_algorithms::push_back
|
||||
(this->tree_type::header_ptr(), to_insert, this->key_node_prio_comp(this->priv_pcomp()));
|
||||
(this->tree_type::header_ptr(), to_insert, this->prio_node_prio_comp(this->priv_pcomp()));
|
||||
this->tree_type::sz_traits().increment();
|
||||
}
|
||||
|
||||
@@ -812,7 +836,7 @@ class treap_impl
|
||||
node_ptr to_insert(this->get_value_traits().to_node_ptr(value));
|
||||
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert));
|
||||
node_algorithms::push_front
|
||||
(this->tree_type::header_ptr(), to_insert, this->key_node_prio_comp(this->priv_pcomp()));
|
||||
(this->tree_type::header_ptr(), to_insert, this->prio_node_prio_comp(this->priv_pcomp()));
|
||||
this->tree_type::sz_traits().increment();
|
||||
}
|
||||
|
||||
@@ -831,7 +855,7 @@ class treap_impl
|
||||
node_ptr to_erase(i.pointed_node());
|
||||
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || !node_algorithms::unique(to_erase));
|
||||
node_algorithms::erase
|
||||
(this->tree_type::header_ptr(), to_erase, this->key_node_prio_comp(this->priv_pcomp()));
|
||||
(this->tree_type::header_ptr(), to_erase, this->prio_node_prio_comp(this->priv_pcomp()));
|
||||
this->tree_type::sz_traits().decrement();
|
||||
if(safemode_or_autounlink)
|
||||
node_algorithms::init(to_erase);
|
||||
@@ -1013,7 +1037,7 @@ class treap_impl
|
||||
#else
|
||||
template<class Compare2>
|
||||
void merge_unique(treap_impl
|
||||
<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
#endif
|
||||
{
|
||||
node_ptr it (node_algorithms::begin_node(source.header_ptr()))
|
||||
@@ -1026,7 +1050,7 @@ class treap_impl
|
||||
|
||||
if( node_algorithms::transfer_unique
|
||||
( this->header_ptr(), this->key_node_comp(this->key_comp())
|
||||
, this->key_node_prio_comp(this->priv_pcomp()), source.header_ptr(), p) ){
|
||||
, this->prio_node_prio_comp(this->priv_pcomp()), source.header_ptr(), p) ){
|
||||
this->sz_traits().increment();
|
||||
source.sz_traits().decrement();
|
||||
}
|
||||
@@ -1039,7 +1063,7 @@ class treap_impl
|
||||
#else
|
||||
template<class Compare2>
|
||||
void merge_equal(treap_impl
|
||||
<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
#endif
|
||||
{
|
||||
node_ptr it (node_algorithms::begin_node(source.header_ptr()))
|
||||
@@ -1051,7 +1075,7 @@ class treap_impl
|
||||
it = node_algorithms::next_node(it);
|
||||
node_algorithms::transfer_equal
|
||||
( this->header_ptr(), this->key_node_comp(this->key_comp())
|
||||
, this->key_node_prio_comp(this->priv_pcomp()), source.header_ptr(), p);
|
||||
, this->prio_node_prio_comp(this->priv_pcomp()), source.header_ptr(), p);
|
||||
this->sz_traits().increment();
|
||||
source.sz_traits().decrement();
|
||||
}
|
||||
@@ -1061,10 +1085,10 @@ class treap_impl
|
||||
template <class ExtraChecker>
|
||||
void check(ExtraChecker extra_checker) const
|
||||
{
|
||||
typedef detail::key_nodeptr_comp<priority_compare, value_traits, key_of_value> nodeptr_prio_comp_t;
|
||||
typedef detail::key_nodeptr_comp<priority_compare, value_traits, priority_of_value> nodeptr_prio_comp_t;
|
||||
tree_type::check(detail::treap_node_extra_checker
|
||||
<ValueTraits, nodeptr_prio_comp_t, ExtraChecker>
|
||||
(this->key_node_prio_comp(this->priv_pcomp()), extra_checker));
|
||||
(this->prio_node_prio_comp(this->priv_pcomp()), extra_checker));
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree::check()const
|
||||
@@ -1222,14 +1246,15 @@ template<class T, class ...Options>
|
||||
#else
|
||||
template<class T, class O1 = void, class O2 = void
|
||||
, class O3 = void, class O4 = void
|
||||
, class O5 = void, class O6 = void>
|
||||
, class O5 = void, class O6 = void
|
||||
, class O7 = void>
|
||||
#endif
|
||||
struct make_treap
|
||||
{
|
||||
typedef typename pack_options
|
||||
< treap_defaults,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -1242,6 +1267,7 @@ struct make_treap
|
||||
< value_traits
|
||||
, typename packed_options::key_of_value
|
||||
, typename packed_options::compare
|
||||
, typename packed_options::priority_of_value
|
||||
, typename packed_options::priority
|
||||
, typename packed_options::size_type
|
||||
, packed_options::constant_time_size
|
||||
@@ -1254,14 +1280,14 @@ struct make_treap
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
|
||||
template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7>
|
||||
#else
|
||||
template<class T, class ...Options>
|
||||
#endif
|
||||
class treap
|
||||
: public make_treap<T,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -1270,7 +1296,7 @@ class treap
|
||||
typedef typename make_treap
|
||||
<T,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -1288,49 +1314,50 @@ class treap
|
||||
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
treap()
|
||||
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit treap( const key_compare &cmp
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit treap( const key_compare &cmp
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
treap( bool unique, Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap( bool unique, Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(unique, b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
treap(BOOST_RV_REF(treap) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap(BOOST_RV_REF(treap) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
treap& operator=(BOOST_RV_REF(treap) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap& operator=(BOOST_RV_REF(treap) x)
|
||||
{ return static_cast<treap&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const treap &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const treap &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(treap) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(treap) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static treap &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static treap &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<treap &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const treap &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const treap &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const treap &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static treap &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static treap &container_from_iterator(iterator it)
|
||||
{ return static_cast<treap &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const treap &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const treap &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const treap &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
@@ -481,16 +481,17 @@ class treap_algorithms
|
||||
//!
|
||||
//! "commit_data" remains valid for a subsequent "insert_unique_commit" only
|
||||
//! if no more objects are inserted or erased from the set.
|
||||
template<class KeyType, class KeyNodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
template<class KeyType, class KeyNodePtrCompare, class PrioType, class PrioNodePtrPrioCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const KeyType &key
|
||||
,KeyNodePtrCompare comp, KeyNodePtrPrioCompare pcomp
|
||||
,insert_commit_data &commit_data)
|
||||
( const_node_ptr header
|
||||
, const KeyType &key, KeyNodePtrCompare comp
|
||||
, const PrioType &prio, PrioNodePtrPrioCompare pcomp
|
||||
, insert_commit_data &commit_data)
|
||||
{
|
||||
std::pair<node_ptr, bool> ret =
|
||||
bstree_algo::insert_unique_check(header, key, comp, commit_data);
|
||||
if(ret.second)
|
||||
rebalance_after_insertion_check(header, commit_data.node, key, pcomp, commit_data.rotations);
|
||||
rebalance_after_insertion_check(header, commit_data.node, prio, pcomp, commit_data.rotations);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -533,15 +534,17 @@ class treap_algorithms
|
||||
//!
|
||||
//! "commit_data" remains valid for a subsequent "insert_unique_commit" only
|
||||
//! if no more objects are inserted or erased from the set.
|
||||
template<class KeyType, class KeyNodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
template<class KeyType, class KeyNodePtrCompare, class PrioType, class PrioNodePtrPrioCompare>
|
||||
static std::pair<node_ptr, bool> insert_unique_check
|
||||
(const const_node_ptr & header, const node_ptr & hint, const KeyType &key
|
||||
,KeyNodePtrCompare comp, KeyNodePtrPrioCompare pcomp, insert_commit_data &commit_data)
|
||||
( const_node_ptr header, node_ptr hint
|
||||
, const KeyType &key, KeyNodePtrCompare comp
|
||||
, const PrioType &prio, PrioNodePtrPrioCompare pcomp
|
||||
, insert_commit_data &commit_data)
|
||||
{
|
||||
std::pair<node_ptr, bool> ret =
|
||||
bstree_algo::insert_unique_check(header, hint, key, comp, commit_data);
|
||||
if(ret.second)
|
||||
rebalance_after_insertion_check(header, commit_data.node, key, pcomp, commit_data.rotations);
|
||||
rebalance_after_insertion_check(header, commit_data.node, prio, pcomp, commit_data.rotations);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -563,19 +566,19 @@ 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);
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_unique
|
||||
template<class NodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
template<class NodePtrCompare, class PrioNodePtrPrioCompare>
|
||||
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, PrioNodePtrPrioCompare 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;
|
||||
bool const transferable = insert_unique_check(header1, z, comp, z, pcomp, commit_data).second;
|
||||
if(transferable){
|
||||
erase(header2, z, pcomp);
|
||||
insert_unique_commit(header1, z, commit_data);
|
||||
@@ -584,9 +587,9 @@ class treap_algorithms
|
||||
}
|
||||
|
||||
//! @copydoc ::boost::intrusive::bstree_algorithms::transfer_equal
|
||||
template<class NodePtrCompare, class KeyNodePtrPrioCompare>
|
||||
template<class NodePtrCompare, class PrioNodePtrPrioCompare>
|
||||
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, PrioNodePtrPrioCompare 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 +603,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 +634,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 +644,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 +659,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);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioOfValue, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
class treap_multiset_impl;
|
||||
#endif
|
||||
|
||||
@@ -45,16 +45,16 @@ class treap_multiset_impl;
|
||||
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
||||
template<class T, class ...Options>
|
||||
#else
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioOfValue, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
#endif
|
||||
class treap_set_impl
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
: public treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder>
|
||||
: public treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder>
|
||||
#endif
|
||||
{
|
||||
/// @cond
|
||||
public:
|
||||
typedef treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> tree_type;
|
||||
typedef treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> tree_type;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_set_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
@@ -73,6 +73,7 @@ class treap_set_impl
|
||||
typedef typename implementation_defined::size_type size_type;
|
||||
typedef typename implementation_defined::value_compare value_compare;
|
||||
typedef typename implementation_defined::key_compare key_compare;
|
||||
typedef typename implementation_defined::priority_type priority_type;
|
||||
typedef typename implementation_defined::priority_compare priority_compare;
|
||||
typedef typename implementation_defined::iterator iterator;
|
||||
typedef typename implementation_defined::const_iterator const_iterator;
|
||||
@@ -243,29 +244,30 @@ class treap_set_impl
|
||||
iterator insert(const_iterator hint, reference value)
|
||||
{ return tree_type::insert_unique(hint, value); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const key_type&,insert_commit_data&)
|
||||
std::pair<iterator, bool> insert_check( const key_type &key, insert_commit_data &commit_data)
|
||||
{ return tree_type::insert_unique_check(key, commit_data); }
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const key_type&,const priority_type &,insert_commit_data&)
|
||||
std::pair<iterator, bool> insert_check( const key_type &key, const priority_type &prio, insert_commit_data &commit_data)
|
||||
{ return tree_type::insert_unique_check(key, prio, commit_data); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const_iterator,const key_type&,const priority_type &,insert_commit_data&)
|
||||
std::pair<iterator, bool> insert_check
|
||||
( const_iterator hint, const key_type &key, insert_commit_data &commit_data)
|
||||
{ return tree_type::insert_unique_check(hint, key, commit_data); }
|
||||
( const_iterator hint, const key_type &key, const priority_type &prio, insert_commit_data &commit_data)
|
||||
{ return tree_type::insert_unique_check(hint, key, prio, commit_data); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const KeyType&,KeyTypeKeyCompare,KeyValuePrioCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyTypeKeyCompare, class KeyValuePrioCompare>
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const KeyType&,KeyTypeKeyCompare,PrioValuePrioCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyTypeKeyCompare, class PrioType, class PrioValuePrioCompare>
|
||||
std::pair<iterator, bool> insert_check
|
||||
( const KeyType &key, KeyTypeKeyCompare comp, KeyValuePrioCompare key_value_pcomp
|
||||
( const KeyType &key, KeyTypeKeyCompare comp, const PrioType &prio, PrioValuePrioCompare pcomp
|
||||
, insert_commit_data &commit_data)
|
||||
{ return tree_type::insert_unique_check(key, comp, key_value_pcomp, commit_data); }
|
||||
{ return tree_type::insert_unique_check(key, comp, prio, pcomp, commit_data); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const_iterator,const KeyType&,KeyTypeKeyCompare,KeyValuePrioCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyTypeKeyCompare, class KeyValuePrioCompare>
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const_iterator,const KeyType&,KeyTypeKeyCompare,PrioValuePrioCompare,insert_commit_data&)
|
||||
template<class KeyType, class KeyTypeKeyCompare, class PrioType, class PrioValuePrioCompare>
|
||||
std::pair<iterator, bool> insert_check
|
||||
( const_iterator hint, const KeyType &key
|
||||
, KeyTypeKeyCompare comp, KeyValuePrioCompare key_value_pcomp
|
||||
( const_iterator hint
|
||||
, const KeyType &key, KeyTypeKeyCompare comp
|
||||
, const PrioType &prio, PrioValuePrioCompare pcomp
|
||||
, insert_commit_data &commit_data)
|
||||
{ return tree_type::insert_unique_check(hint, key, comp, key_value_pcomp, commit_data); }
|
||||
{ return tree_type::insert_unique_check(hint, key, comp, prio, pcomp, commit_data); }
|
||||
|
||||
//! @copydoc ::boost::intrusive::treap::insert_unique(Iterator,Iterator)
|
||||
template<class Iterator>
|
||||
@@ -455,11 +457,11 @@ class treap_set_impl
|
||||
#else
|
||||
|
||||
template<class Compare2>
|
||||
void merge(treap_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
void merge(treap_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
{ return tree_type::merge_unique(source); }
|
||||
|
||||
template<class Compare2>
|
||||
void merge(treap_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
void merge(treap_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
{ return tree_type::merge_unique(source); }
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
@@ -473,14 +475,15 @@ template<class T, class ...Options>
|
||||
#else
|
||||
template<class T, class O1 = void, class O2 = void
|
||||
, class O3 = void, class O4 = void
|
||||
, class O5 = void, class O6 = void>
|
||||
, class O5 = void, class O6 = void
|
||||
, class O7 = void>
|
||||
#endif
|
||||
struct make_treap_set
|
||||
{
|
||||
typedef typename pack_options
|
||||
< treap_defaults,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -493,6 +496,7 @@ struct make_treap_set
|
||||
< value_traits
|
||||
, typename packed_options::key_of_value
|
||||
, typename packed_options::compare
|
||||
, typename packed_options::priority_of_value
|
||||
, typename packed_options::priority
|
||||
, typename packed_options::size_type
|
||||
, packed_options::constant_time_size
|
||||
@@ -505,14 +509,14 @@ struct make_treap_set
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
|
||||
template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7>
|
||||
#else
|
||||
template<class T, class ...Options>
|
||||
#endif
|
||||
class treap_set
|
||||
: public make_treap_set<T,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -521,7 +525,7 @@ class treap_set
|
||||
typedef typename make_treap_set
|
||||
<T,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -538,49 +542,49 @@ class treap_set
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
treap_set()
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_set()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit treap_set( const key_compare &cmp
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit treap_set( const key_compare &cmp
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
treap_set( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_set( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
treap_set(BOOST_RV_REF(treap_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_set(BOOST_RV_REF(treap_set) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
treap_set& operator=(BOOST_RV_REF(treap_set) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_set& operator=(BOOST_RV_REF(treap_set) x)
|
||||
{ return static_cast<treap_set &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const treap_set &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const treap_set &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(treap_set) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(treap_set) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static treap_set &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static treap_set &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<treap_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const treap_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const treap_set &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const treap_set &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static treap_set &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static treap_set &container_from_iterator(iterator it)
|
||||
{ return static_cast<treap_set &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const treap_set &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const treap_set &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const treap_set &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
@@ -600,15 +604,15 @@ class treap_set
|
||||
#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
|
||||
template<class T, class ...Options>
|
||||
#else
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
template<class ValueTraits, class VoidOrKeyOfValue, class VoidOrKeyComp, class VoidOrPrioOfValue, class VoidOrPrioComp, class SizeType, bool ConstantTimeSize, typename HeaderHolder>
|
||||
#endif
|
||||
class treap_multiset_impl
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
: public treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder>
|
||||
: public treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder>
|
||||
#endif
|
||||
{
|
||||
/// @cond
|
||||
typedef treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> tree_type;
|
||||
typedef treap_impl<ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> tree_type;
|
||||
BOOST_MOVABLE_BUT_NOT_COPYABLE(treap_multiset_impl)
|
||||
|
||||
typedef tree_type implementation_defined;
|
||||
@@ -627,6 +631,7 @@ class treap_multiset_impl
|
||||
typedef typename implementation_defined::size_type size_type;
|
||||
typedef typename implementation_defined::value_compare value_compare;
|
||||
typedef typename implementation_defined::key_compare key_compare;
|
||||
typedef typename implementation_defined::priority_type priority_type;
|
||||
typedef typename implementation_defined::priority_compare priority_compare;
|
||||
typedef typename implementation_defined::iterator iterator;
|
||||
typedef typename implementation_defined::const_iterator const_iterator;
|
||||
@@ -967,11 +972,11 @@ class treap_multiset_impl
|
||||
#else
|
||||
|
||||
template<class Compare2>
|
||||
void merge(treap_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
void merge(treap_multiset_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
{ return tree_type::merge_equal(source); }
|
||||
|
||||
template<class Compare2>
|
||||
void merge(treap_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
void merge(treap_set_impl<ValueTraits, VoidOrKeyOfValue, Compare2, VoidOrPrioOfValue, VoidOrPrioComp, SizeType, ConstantTimeSize, HeaderHolder> &source)
|
||||
{ return tree_type::merge_equal(source); }
|
||||
|
||||
#endif //#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
@@ -985,14 +990,15 @@ template<class T, class ...Options>
|
||||
#else
|
||||
template<class T, class O1 = void, class O2 = void
|
||||
, class O3 = void, class O4 = void
|
||||
, class O5 = void, class O6 = void>
|
||||
, class O5 = void, class O6 = void
|
||||
, class O7 = void>
|
||||
#endif
|
||||
struct make_treap_multiset
|
||||
{
|
||||
typedef typename pack_options
|
||||
< treap_defaults,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -1005,6 +1011,7 @@ struct make_treap_multiset
|
||||
< value_traits
|
||||
, typename packed_options::key_of_value
|
||||
, typename packed_options::compare
|
||||
, typename packed_options::priority_of_value
|
||||
, typename packed_options::priority
|
||||
, typename packed_options::size_type
|
||||
, packed_options::constant_time_size
|
||||
@@ -1017,14 +1024,14 @@ struct make_treap_multiset
|
||||
#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
|
||||
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
|
||||
template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7>
|
||||
#else
|
||||
template<class T, class ...Options>
|
||||
#endif
|
||||
class treap_multiset
|
||||
: public make_treap_multiset<T,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -1033,7 +1040,7 @@ class treap_multiset
|
||||
typedef typename make_treap_multiset
|
||||
<T,
|
||||
#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||
O1, O2, O3, O4, O5, O6
|
||||
O1, O2, O3, O4, O5, O6, O7
|
||||
#else
|
||||
Options...
|
||||
#endif
|
||||
@@ -1050,49 +1057,49 @@ class treap_multiset
|
||||
//Assert if passed value traits are compatible with the type
|
||||
BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
|
||||
|
||||
treap_multiset()
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_multiset()
|
||||
: Base()
|
||||
{}
|
||||
|
||||
explicit treap_multiset( const key_compare &cmp
|
||||
BOOST_INTRUSIVE_FORCEINLINE explicit treap_multiset( const key_compare &cmp
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
template<class Iterator>
|
||||
treap_multiset( Iterator b, Iterator e
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_multiset( Iterator b, Iterator e
|
||||
, const key_compare &cmp = key_compare()
|
||||
, const priority_compare &pcmp = priority_compare()
|
||||
, const value_traits &v_traits = value_traits())
|
||||
: Base(b, e, cmp, pcmp, v_traits)
|
||||
{}
|
||||
|
||||
treap_multiset(BOOST_RV_REF(treap_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_multiset(BOOST_RV_REF(treap_multiset) x)
|
||||
: Base(BOOST_MOVE_BASE(Base, x))
|
||||
{}
|
||||
|
||||
treap_multiset& operator=(BOOST_RV_REF(treap_multiset) x)
|
||||
BOOST_INTRUSIVE_FORCEINLINE treap_multiset& operator=(BOOST_RV_REF(treap_multiset) x)
|
||||
{ return static_cast<treap_multiset &>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(const treap_multiset &src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(const treap_multiset &src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(src, cloner, disposer); }
|
||||
|
||||
template <class Cloner, class Disposer>
|
||||
void clone_from(BOOST_RV_REF(treap_multiset) src, Cloner cloner, Disposer disposer)
|
||||
BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(treap_multiset) src, Cloner cloner, Disposer disposer)
|
||||
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
|
||||
|
||||
static treap_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static treap_multiset &container_from_end_iterator(iterator end_iterator)
|
||||
{ return static_cast<treap_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static const treap_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const treap_multiset &container_from_end_iterator(const_iterator end_iterator)
|
||||
{ return static_cast<const treap_multiset &>(Base::container_from_end_iterator(end_iterator)); }
|
||||
|
||||
static treap_multiset &container_from_iterator(iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static treap_multiset &container_from_iterator(iterator it)
|
||||
{ return static_cast<treap_multiset &>(Base::container_from_iterator(it)); }
|
||||
|
||||
static const treap_multiset &container_from_iterator(const_iterator it)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static const treap_multiset &container_from_iterator(const_iterator it)
|
||||
{ return static_cast<const treap_multiset &>(Base::container_from_iterator(it)); }
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -82,22 +82,22 @@ struct unordered_node_traits
|
||||
static const bool store_hash = StoreHash;
|
||||
static const bool optimize_multikey = OptimizeMultiKey;
|
||||
|
||||
static node_ptr get_next(const const_node_ptr & n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_hash(const const_node_ptr & n)
|
||||
{ return n->hash_; }
|
||||
|
||||
static void set_hash(const node_ptr & n, std::size_t h)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void set_hash(const node_ptr & n, std::size_t h)
|
||||
{ n->hash_ = h; }
|
||||
};
|
||||
|
||||
@@ -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); }
|
||||
};
|
||||
|
||||
@@ -127,19 +127,19 @@ struct unordered_algorithms
|
||||
typedef typename NodeTraits::node_ptr node_ptr;
|
||||
typedef typename NodeTraits::const_node_ptr const_node_ptr;
|
||||
|
||||
static void init(typename base_type::node_ptr n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init(typename base_type::node_ptr n)
|
||||
{
|
||||
base_type::init(n);
|
||||
group_algorithms::init(n);
|
||||
}
|
||||
|
||||
static void init_header(typename base_type::node_ptr n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void init_header(typename base_type::node_ptr n)
|
||||
{
|
||||
base_type::init_header(n);
|
||||
group_algorithms::init_header(n);
|
||||
}
|
||||
|
||||
static void unlink(typename base_type::node_ptr n)
|
||||
BOOST_INTRUSIVE_FORCEINLINE static void unlink(typename base_type::node_ptr n)
|
||||
{
|
||||
base_type::unlink(n);
|
||||
group_algorithms::unlink(n);
|
||||
|
||||
Reference in New Issue
Block a user