summaryrefslogtreecommitdiff
path: root/boost/intrusive/detail
diff options
context:
space:
mode:
Diffstat (limited to 'boost/intrusive/detail')
-rw-r--r--boost/intrusive/detail/any_node_and_algorithms.hpp28
-rw-r--r--boost/intrusive/detail/avltree_node.hpp18
-rw-r--r--boost/intrusive/detail/common_slist_algorithms.hpp14
-rw-r--r--boost/intrusive/detail/list_iterator.hpp2
-rw-r--r--boost/intrusive/detail/list_node.hpp4
-rw-r--r--boost/intrusive/detail/node_cloner_disposer.hpp4
-rw-r--r--boost/intrusive/detail/rbtree_node.hpp12
-rw-r--r--boost/intrusive/detail/simple_disposers.hpp2
-rw-r--r--boost/intrusive/detail/slist_iterator.hpp2
-rw-r--r--boost/intrusive/detail/slist_node.hpp2
-rw-r--r--boost/intrusive/detail/tree_iterator.hpp2
-rw-r--r--boost/intrusive/detail/tree_node.hpp6
-rw-r--r--boost/intrusive/detail/tree_value_compare.hpp47
13 files changed, 81 insertions, 62 deletions
diff --git a/boost/intrusive/detail/any_node_and_algorithms.hpp b/boost/intrusive/detail/any_node_and_algorithms.hpp
index 26a1edcd3e..f04491840d 100644
--- a/boost/intrusive/detail/any_node_and_algorithms.hpp
+++ b/boost/intrusive/detail/any_node_and_algorithms.hpp
@@ -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; }
};
diff --git a/boost/intrusive/detail/avltree_node.hpp b/boost/intrusive/detail/avltree_node.hpp
index 16d1c1d291..85a864260c 100644
--- a/boost/intrusive/detail/avltree_node.hpp
+++ b/boost/intrusive/detail/avltree_node.hpp
@@ -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)
diff --git a/boost/intrusive/detail/common_slist_algorithms.hpp b/boost/intrusive/detail/common_slist_algorithms.hpp
index 5e6ff4d1aa..88f3fedac5 100644
--- a/boost/intrusive/detail/common_slist_algorithms.hpp
+++ b/boost/intrusive/detail/common_slist_algorithms.hpp
@@ -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);
diff --git a/boost/intrusive/detail/list_iterator.hpp b/boost/intrusive/detail/list_iterator.hpp
index 6c5f161675..3aae2d5a54 100644
--- a/boost/intrusive/detail/list_iterator.hpp
+++ b/boost/intrusive/detail/list_iterator.hpp
@@ -66,7 +66,7 @@ class list_iterator
: members_(other.pointed_node(), other.get_value_traits())
{}
- BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
{ return members_.nodeptr_; }
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
diff --git a/boost/intrusive/detail/list_node.hpp b/boost/intrusive/detail/list_node.hpp
index c3b4847011..bc30e89f25 100644
--- a/boost/intrusive/detail/list_node.hpp
+++ b/boost/intrusive/detail/list_node.hpp
@@ -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; }
};
diff --git a/boost/intrusive/detail/node_cloner_disposer.hpp b/boost/intrusive/detail/node_cloner_disposer.hpp
index 3fe2954347..8ed3c4dab2 100644
--- a/boost/intrusive/detail/node_cloner_disposer.hpp
+++ b/boost/intrusive/detail/node_cloner_disposer.hpp
@@ -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);
diff --git a/boost/intrusive/detail/rbtree_node.hpp b/boost/intrusive/detail/rbtree_node.hpp
index 68f4bdf8e2..8b573ecc21 100644
--- a/boost/intrusive/detail/rbtree_node.hpp
+++ b/boost/intrusive/detail/rbtree_node.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)
diff --git a/boost/intrusive/detail/simple_disposers.hpp b/boost/intrusive/detail/simple_disposers.hpp
index 1420b281b0..f9d23bf62e 100644
--- a/boost/intrusive/detail/simple_disposers.hpp
+++ b/boost/intrusive/detail/simple_disposers.hpp
@@ -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); }
};
diff --git a/boost/intrusive/detail/slist_iterator.hpp b/boost/intrusive/detail/slist_iterator.hpp
index 63ce5c3fef..96a5ac0191 100644
--- a/boost/intrusive/detail/slist_iterator.hpp
+++ b/boost/intrusive/detail/slist_iterator.hpp
@@ -68,7 +68,7 @@ class slist_iterator
: members_(other.pointed_node(), other.get_value_traits())
{}
- BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
{ return members_.nodeptr_; }
BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const node_ptr &node)
diff --git a/boost/intrusive/detail/slist_node.hpp b/boost/intrusive/detail/slist_node.hpp
index 848764e571..ee8ab40a3d 100644
--- a/boost/intrusive/detail/slist_node.hpp
+++ b/boost/intrusive/detail/slist_node.hpp
@@ -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; }
};
diff --git a/boost/intrusive/detail/tree_iterator.hpp b/boost/intrusive/detail/tree_iterator.hpp
index f36a1f244b..a4bbc1b066 100644
--- a/boost/intrusive/detail/tree_iterator.hpp
+++ b/boost/intrusive/detail/tree_iterator.hpp
@@ -74,7 +74,7 @@ class tree_iterator
: members_(other.pointed_node(), other.get_value_traits())
{}
- BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
{ return members_.nodeptr_; }
BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const node_ptr &nodeptr)
diff --git a/boost/intrusive/detail/tree_node.hpp b/boost/intrusive/detail/tree_node.hpp
index 606fbc865e..6df3343e03 100644
--- a/boost/intrusive/detail/tree_node.hpp
+++ b/boost/intrusive/detail/tree_node.hpp
@@ -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; }
};
diff --git a/boost/intrusive/detail/tree_value_compare.hpp b/boost/intrusive/detail/tree_value_compare.hpp
index f6dd01dc25..c78da0acd6 100644
--- a/boost/intrusive/detail/tree_value_compare.hpp
+++ b/boost/intrusive/detail/tree_value_compare.hpp
@@ -45,7 +45,7 @@ struct disable_if_smartref_to
//This function object takes a KeyCompare function object
//and compares values that contains keys using KeyOfValue
-template< class ValuePtr, class KeyCompare, class KeyOfValue
+template< class ValuePtr, class KeyCompare, class KeyOfValue, class Ret = bool
, bool = boost::intrusive::detail::is_same
<typename boost::movelib::pointer_element<ValuePtr>::type, typename KeyOfValue::type>::value >
struct tree_value_compare
@@ -80,41 +80,52 @@ struct tree_value_compare
BOOST_INTRUSIVE_FORCEINLINE const key_compare &key_comp() const
{ return static_cast<const key_compare &>(*this); }
- BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key) const
+ { return this->key_comp()(key); }
+
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const value_type &value) const
+ { return this->key_comp()(KeyOfValue()(value)); }
+
+ template<class U>
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
+ , typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
+ { return this->key_comp()(nonkey); }
+
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
{ return this->key_comp()(key1, key2); }
- BOOST_INTRUSIVE_FORCEINLINE bool operator()(const value_type &value1, const value_type &value2) const
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const value_type &value1, const value_type &value2) const
{ return this->key_comp()(KeyOfValue()(value1), KeyOfValue()(value2)); }
- BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const value_type &value2) const
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const value_type &value2) const
{ return this->key_comp()(key1, KeyOfValue()(value2)); }
- BOOST_INTRUSIVE_FORCEINLINE bool operator()(const value_type &value1, const key_type &key2) const
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const value_type &value1, const key_type &key2) const
{ return this->key_comp()(KeyOfValue()(value1), key2); }
template<class U>
- BOOST_INTRUSIVE_FORCEINLINE bool operator()( const key_type &key1, const U &nonkey2
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
{ return this->key_comp()(key1, nonkey2); }
template<class U>
- BOOST_INTRUSIVE_FORCEINLINE bool operator()( const U &nonkey1, const key_type &key2
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey1, const key_type &key2
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
{ return this->key_comp()(nonkey1, key2); }
template<class U>
- BOOST_INTRUSIVE_FORCEINLINE bool operator()( const value_type &value1, const U &nonvalue2
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const value_type &value1, const U &nonvalue2
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
{ return this->key_comp()(KeyOfValue()(value1), nonvalue2); }
template<class U>
- BOOST_INTRUSIVE_FORCEINLINE bool operator()( const U &nonvalue1, const value_type &value2
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonvalue1, const value_type &value2
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
{ return this->key_comp()(nonvalue1, KeyOfValue()(value2)); }
};
-template<class ValuePtr, class KeyCompare, class KeyOfValue>
-struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, true>
+template<class ValuePtr, class KeyCompare, class KeyOfValue, class Ret>
+struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, Ret, true>
: public boost::intrusive::detail::ebo_functor_holder<KeyCompare>
{
typedef typename
@@ -147,16 +158,24 @@ struct tree_value_compare<ValuePtr, KeyCompare, KeyOfValue, true>
BOOST_INTRUSIVE_FORCEINLINE const key_compare &key_comp() const
{ return static_cast<const key_compare &>(*this); }
- BOOST_INTRUSIVE_FORCEINLINE bool operator()(const key_type &key1, const key_type &key2) const
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key) const
+ { return this->key_comp()(key); }
+
+ template<class U>
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const U &nonkey
+ , typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
+ { return this->key_comp()(nonkey); }
+
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const key_type &key1, const key_type &key2) const
{ return this->key_comp()(key1, key2); }
template<class U>
- BOOST_INTRUSIVE_FORCEINLINE bool operator()( const key_type &key1, const U &nonkey2
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()( const key_type &key1, const U &nonkey2
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
{ return this->key_comp()(key1, nonkey2); }
template<class U>
- BOOST_INTRUSIVE_FORCEINLINE bool operator()(const U &nonkey1, const key_type &key2
+ BOOST_INTRUSIVE_FORCEINLINE Ret operator()(const U &nonkey1, const key_type &key2
, typename disable_if_smartref_to<U, ValuePtr>::type* = 0) const
{ return this->key_comp()(nonkey1, key2); }
};