summaryrefslogtreecommitdiff
path: root/boost/intrusive
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 01:38:45 (GMT)
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 01:39:52 (GMT)
commit5cde13f21d36c7224b0e13d11c4b49379ae5210d (patch)
treee8269ac85a4b0f7d416e2565fa4f451b5cb41351 /boost/intrusive
parentd9ec475d945d3035377a0d89ed42e382d8988891 (diff)
downloadboost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.zip
boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.gz
boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.bz2
Imported Upstream version 1.61.0refs/changes/08/91108/1
Change-Id: I96a1f878d1e6164f01e9aadd5147f38fca448d90 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/intrusive')
-rw-r--r--boost/intrusive/avl_set.hpp49
-rw-r--r--boost/intrusive/avltree.hpp22
-rw-r--r--boost/intrusive/bs_set.hpp41
-rw-r--r--boost/intrusive/bstree.hpp38
-rw-r--r--boost/intrusive/detail/any_node_and_algorithms.hpp89
-rw-r--r--boost/intrusive/detail/avltree_node.hpp53
-rw-r--r--boost/intrusive/detail/bstree_algorithms_base.hpp4
-rw-r--r--boost/intrusive/detail/config_begin.hpp11
-rw-r--r--boost/intrusive/detail/default_header_holder.hpp7
-rw-r--r--boost/intrusive/detail/ebo_functor_holder.hpp51
-rw-r--r--boost/intrusive/detail/equal_to_value.hpp4
-rw-r--r--boost/intrusive/detail/exception_disposer.hpp6
-rw-r--r--boost/intrusive/detail/has_member_function_callable_with.hpp5
-rw-r--r--boost/intrusive/detail/hashtable_node.hpp33
-rw-r--r--boost/intrusive/detail/hook_traits.hpp17
-rw-r--r--boost/intrusive/detail/iiterator.hpp15
-rw-r--r--boost/intrusive/detail/iterator.hpp31
-rw-r--r--boost/intrusive/detail/list_iterator.hpp43
-rw-r--r--boost/intrusive/detail/list_node.hpp13
-rw-r--r--boost/intrusive/detail/parent_from_member.hpp9
-rw-r--r--boost/intrusive/detail/rbtree_node.hpp57
-rw-r--r--boost/intrusive/detail/reverse_iterator.hpp45
-rw-r--r--boost/intrusive/detail/size_holder.hpp26
-rw-r--r--boost/intrusive/detail/slist_iterator.hpp41
-rw-r--r--boost/intrusive/detail/slist_node.hpp7
-rw-r--r--boost/intrusive/detail/to_raw_pointer.hpp5
-rw-r--r--boost/intrusive/detail/transform_iterator.hpp45
-rw-r--r--boost/intrusive/detail/tree_iterator.hpp45
-rw-r--r--boost/intrusive/detail/tree_node.hpp19
-rw-r--r--boost/intrusive/detail/tree_value_compare.hpp11
-rw-r--r--boost/intrusive/detail/workaround.hpp12
-rw-r--r--boost/intrusive/hashtable.hpp34
-rw-r--r--boost/intrusive/list.hpp21
-rw-r--r--boost/intrusive/member_value_traits.hpp8
-rw-r--r--boost/intrusive/parent_from_member.hpp5
-rw-r--r--boost/intrusive/pointer_plus_bits.hpp8
-rw-r--r--boost/intrusive/pointer_traits.hpp8
-rw-r--r--boost/intrusive/priority_compare.hpp7
-rw-r--r--boost/intrusive/rbtree.hpp23
-rw-r--r--boost/intrusive/set.hpp41
-rw-r--r--boost/intrusive/sg_set.hpp49
-rw-r--r--boost/intrusive/sgtree.hpp31
-rw-r--r--boost/intrusive/slist.hpp18
-rw-r--r--boost/intrusive/splay_set.hpp41
-rw-r--r--boost/intrusive/splaytree.hpp23
-rw-r--r--boost/intrusive/treap.hpp128
-rw-r--r--boost/intrusive/treap_set.hpp86
-rw-r--r--boost/intrusive/trivial_value_traits.hpp9
-rw-r--r--boost/intrusive/unordered_set.hpp4
49 files changed, 911 insertions, 487 deletions
diff --git a/boost/intrusive/avl_set.hpp b/boost/intrusive/avl_set.hpp
index 5c51e59..2c96204 100644
--- a/boost/intrusive/avl_set.hpp
+++ b/boost/intrusive/avl_set.hpp
@@ -82,9 +82,13 @@ class avl_set_impl
public:
+ //! @copydoc ::boost::intrusive::avltree::avltree()
+ avl_set_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::avltree::avltree(const key_compare &,const value_traits &)
- explicit avl_set_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit avl_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -196,6 +200,17 @@ class avl_set_impl
iterator insert(const_iterator hint, reference value)
{ return tree_type::insert_unique(hint, value); }
+ //! @copydoc ::boost::intrusive::avltree::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::avltree::insert_unique_check(const_iterator,const key_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); }
+
//! @copydoc ::boost::intrusive::avltree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_check
@@ -321,21 +336,21 @@ class avl_set_impl
#endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)
+ //! @copydoc ::boost::intrusive::avltree::equal_range(const key_type &)
std::pair<iterator,iterator> equal_range(const key_type &key)
{ return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)
+ //! @copydoc ::boost::intrusive::avltree::equal_range(const KeyType&,KeyTypeKeyCompare)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp)
{ return this->tree_type::equal_range(key, comp); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)const
+ //! @copydoc ::boost::intrusive::avltree::equal_range(const key_type &)const
std::pair<const_iterator, const_iterator>
equal_range(const key_type &key) const
{ return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)const
+ //! @copydoc ::boost::intrusive::avltree::equal_range(const KeyType&,KeyTypeKeyCompare)const
template<class KeyType, class KeyTypeKeyCompare>
std::pair<const_iterator, const_iterator>
equal_range(const KeyType& key, KeyTypeKeyCompare comp) const
@@ -476,8 +491,11 @@ 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));
- explicit avl_set( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ avl_set()
+ : Base()
+ {}
+
+ explicit avl_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
@@ -573,9 +591,13 @@ class avl_multiset_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::avltree::avltree()
+ avl_multiset_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::avltree::avltree(const key_compare &,const value_traits &)
- explicit avl_multiset_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit avl_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -936,8 +958,11 @@ 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));
- explicit avl_multiset( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ avl_multiset()
+ : Base()
+ {}
+
+ explicit avl_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/avltree.hpp b/boost/intrusive/avltree.hpp
index 8462293..741d482 100644
--- a/boost/intrusive/avltree.hpp
+++ b/boost/intrusive/avltree.hpp
@@ -121,10 +121,13 @@ class avltree_impl
typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ //! @copydoc ::boost::intrusive::bstree::bstree()
+ avltree_impl()
+ : tree_type()
+ {}
//! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit avltree_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit avltree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -257,6 +260,14 @@ class avltree_impl
(const_iterator hint, const KeyType &key
,KeyTypeKeyCompare comp, insert_commit_data &commit_data);
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&)
+ std::pair<iterator, bool> insert_unique_check
+ (const key_type &key, insert_commit_data &commit_data);
+
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const key_type &key, insert_commit_data &commit_data);
+
//! @copydoc ::boost::intrusive::bstree::insert_unique_commit
iterator insert_unique_commit(reference value, const insert_commit_data &commit_data);
@@ -507,8 +518,11 @@ 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));
- explicit avltree( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ avltree()
+ : Base()
+ {}
+
+ explicit avltree( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/bs_set.hpp b/boost/intrusive/bs_set.hpp
index 2f560f5..60f18a1 100644
--- a/boost/intrusive/bs_set.hpp
+++ b/boost/intrusive/bs_set.hpp
@@ -80,9 +80,13 @@ class bs_set_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::bstree::bstree()
+ bs_set_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit bs_set_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit bs_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -193,6 +197,17 @@ class bs_set_impl
iterator insert(const_iterator hint, reference value)
{ return tree_type::insert_unique(hint, value); }
+ //! @copydoc ::boost::intrusive::bstree::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::bstree::insert_unique_check(const_iterator,const key_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); }
+
//! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_check
@@ -473,8 +488,11 @@ 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));
- explicit bs_set( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ bs_set()
+ : Base()
+ {}
+
+ explicit bs_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
@@ -569,9 +587,13 @@ class bs_multiset_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::bstree::bstree()
+ bs_multiset_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit bs_multiset_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit bs_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -932,8 +954,11 @@ 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));
- explicit bs_multiset( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ bs_multiset()
+ : Base()
+ {}
+
+ explicit bs_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/bstree.hpp b/boost/intrusive/bstree.hpp
index b08c49b..0fb9218 100644
--- a/boost/intrusive/bstree.hpp
+++ b/boost/intrusive/bstree.hpp
@@ -476,8 +476,20 @@ struct bstbase2
}
//insert_unique_check
- template<class KeyType, class KeyTypeKeyCompare>
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(), commit_data); }
+
+ 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(), commit_data); }
+
+ template<class KeyType, class KeyTypeKeyCompare>
+ 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, insert_commit_data &commit_data)
{
std::pair<node_ptr, bool> ret =
@@ -488,8 +500,7 @@ struct bstbase2
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_unique_check
- (const_iterator hint, const KeyType &key
- ,KeyTypeKeyCompare comp, insert_commit_data &commit_data)
+ (const_iterator hint, const KeyType &key, KeyTypeKeyCompare comp, insert_commit_data &commit_data)
{
std::pair<node_ptr, bool> ret =
(node_algorithms::insert_unique_check
@@ -679,8 +690,18 @@ class bstree_impl
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the key_compare object throws. Basic guarantee.
- explicit bstree_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ bstree_impl()
+ : data_type(key_compare(), value_traits())
+ {}
+
+ //! <b>Effects</b>: Constructs an empty container with given comparison and traits.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the key_compare object throws. Basic guarantee.
+ explicit bstree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: data_type(cmp, v_traits)
{}
@@ -2052,8 +2073,11 @@ 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( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ bstree()
+ : Base()
+ {}
+
+ explicit bstree( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/detail/any_node_and_algorithms.hpp b/boost/intrusive/detail/any_node_and_algorithms.hpp
index 3c76e58..4b087b5 100644
--- a/boost/intrusive/detail/any_node_and_algorithms.hpp
+++ b/boost/intrusive/detail/any_node_and_algorithms.hpp
@@ -21,6 +21,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_rebind.hpp>
#include <cstddef>
#include <boost/intrusive/detail/mpl.hpp>
@@ -47,16 +48,16 @@ struct any_list_node_traits
typedef typename node::node_ptr node_ptr;
typedef typename node::const_node_ptr const_node_ptr;
- static node_ptr get_next(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
{ return n->node_ptr_1; }
- static void set_next(const node_ptr & n, const node_ptr & next)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
{ n->node_ptr_1 = next; }
- static node_ptr get_previous(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const const_node_ptr & n)
{ return n->node_ptr_2; }
- static void set_previous(const node_ptr & n, const node_ptr & prev)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_previous(const node_ptr & n, const node_ptr & prev)
{ n->node_ptr_2 = prev; }
};
@@ -68,10 +69,10 @@ struct any_slist_node_traits
typedef typename node::node_ptr node_ptr;
typedef typename node::const_node_ptr const_node_ptr;
- static node_ptr get_next(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
{ return n->node_ptr_1; }
- static void set_next(const node_ptr & n, const node_ptr & next)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
{ n->node_ptr_1 = next; }
};
@@ -88,22 +89,22 @@ struct any_unordered_node_traits
static const bool store_hash = true;
static const bool optimize_multikey = true;
- static node_ptr get_next(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
{ return n->node_ptr_1; }
- static void set_next(const node_ptr & n, const node_ptr & next)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
{ n->node_ptr_1 = 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->node_ptr_2; }
- static void set_prev_in_group(const node_ptr & n, const node_ptr & prev)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_prev_in_group(const node_ptr & n, const node_ptr & prev)
{ n->node_ptr_2 = 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->size_t_1; }
- 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->size_t_1 = h; }
};
@@ -117,34 +118,34 @@ struct any_rbtree_node_traits
typedef std::size_t color;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return n->node_ptr_1; }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ n->node_ptr_1 = p; }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->node_ptr_2; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->node_ptr_2 = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->node_ptr_3; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->node_ptr_3 = r; }
- static color get_color(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
{ return n->size_t_1; }
- static void set_color(const node_ptr & n, color c)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c)
{ n->size_t_1 = c; }
- static color black()
+ BOOST_INTRUSIVE_FORCEINLINE static color black()
{ return 0u; }
- static color red()
+ BOOST_INTRUSIVE_FORCEINLINE static color red()
{ return 1u; }
};
@@ -158,37 +159,37 @@ struct any_avltree_node_traits
typedef std::size_t balance;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return n->node_ptr_1; }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ n->node_ptr_1 = p; }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->node_ptr_2; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->node_ptr_2 = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->node_ptr_3; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->node_ptr_3 = r; }
- static balance get_balance(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
{ return n->size_t_1; }
- static void set_balance(const node_ptr & n, balance b)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b)
{ n->size_t_1 = b; }
- static balance negative()
+ BOOST_INTRUSIVE_FORCEINLINE static balance negative()
{ return 0u; }
- static balance zero()
+ BOOST_INTRUSIVE_FORCEINLINE static balance zero()
{ return 1u; }
- static balance positive()
+ BOOST_INTRUSIVE_FORCEINLINE static balance positive()
{ return 2u; }
};
@@ -200,22 +201,22 @@ struct any_tree_node_traits
typedef typename node::node_ptr node_ptr;
typedef typename node::const_node_ptr const_node_ptr;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return n->node_ptr_1; }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ n->node_ptr_1 = p; }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->node_ptr_2; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->node_ptr_2 = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->node_ptr_3; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->node_ptr_3 = r; }
};
@@ -250,19 +251,19 @@ class any_algorithms
//! <b>Throws</b>: Nothing.
//!
//! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
- static void init(const node_ptr & node)
- { node->node_ptr_1 = 0; };
+ BOOST_INTRUSIVE_FORCEINLINE static void init(const node_ptr & node)
+ { node->node_ptr_1 = node_ptr(); };
//! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
//!
//! <b>Complexity</b>: Constant.
//!
//! <b>Throws</b>: Nothing.
- static bool inited(const const_node_ptr & node)
+ BOOST_INTRUSIVE_FORCEINLINE static bool inited(const const_node_ptr & node)
{ return !node->node_ptr_1; };
- static bool unique(const const_node_ptr & node)
- { return 0 == node->node_ptr_1; }
+ BOOST_INTRUSIVE_FORCEINLINE static bool unique(const const_node_ptr & node)
+ { return !node->node_ptr_1; }
static void unlink(const node_ptr &)
{
diff --git a/boost/intrusive/detail/avltree_node.hpp b/boost/intrusive/detail/avltree_node.hpp
index 22b8fd1..16d1c1d 100644
--- a/boost/intrusive/detail/avltree_node.hpp
+++ b/boost/intrusive/detail/avltree_node.hpp
@@ -22,6 +22,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_rebind.hpp>
#include <boost/intrusive/avltree_algorithms.hpp>
#include <boost/intrusive/pointer_plus_bits.hpp>
@@ -68,49 +69,49 @@ struct default_avltree_node_traits_impl
typedef typename node::balance balance;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return n->parent_; }
- static node_ptr get_parent(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
{ return n->parent_; }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ n->parent_ = p; }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->left_; }
- static node_ptr get_left(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
{ return n->left_; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->left_ = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->right_; }
- static node_ptr get_right(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
{ return n->right_; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->right_ = r; }
- static balance get_balance(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
{ return n->balance_; }
- static balance get_balance(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const node_ptr & n)
{ return n->balance_; }
- static void set_balance(const node_ptr & n, balance b)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b)
{ n->balance_ = b; }
- static balance negative()
+ BOOST_INTRUSIVE_FORCEINLINE static balance negative()
{ return node::negative_t; }
- static balance zero()
+ BOOST_INTRUSIVE_FORCEINLINE static balance zero()
{ return node::zero_t; }
- static balance positive()
+ BOOST_INTRUSIVE_FORCEINLINE static balance positive()
{ return node::positive_t; }
};
@@ -126,37 +127,37 @@ struct compact_avltree_node_traits_impl
typedef pointer_plus_bits<node_ptr, 2> ptr_bit;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return ptr_bit::get_pointer(n->parent_); }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ ptr_bit::set_pointer(n->parent_, p); }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->left_; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->left_ = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->right_; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->right_ = r; }
- static balance get_balance(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static balance get_balance(const const_node_ptr & n)
{ return (balance)ptr_bit::get_bits(n->parent_); }
- static void set_balance(const node_ptr & n, balance b)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_balance(const node_ptr & n, balance b)
{ ptr_bit::set_bits(n->parent_, (std::size_t)b); }
- static balance negative()
+ BOOST_INTRUSIVE_FORCEINLINE static balance negative()
{ return node::negative_t; }
- static balance zero()
+ BOOST_INTRUSIVE_FORCEINLINE static balance zero()
{ return node::zero_t; }
- static balance positive()
+ BOOST_INTRUSIVE_FORCEINLINE static balance positive()
{ return node::positive_t; }
};
diff --git a/boost/intrusive/detail/bstree_algorithms_base.hpp b/boost/intrusive/detail/bstree_algorithms_base.hpp
index ed28a43..8404010 100644
--- a/boost/intrusive/detail/bstree_algorithms_base.hpp
+++ b/boost/intrusive/detail/bstree_algorithms_base.hpp
@@ -69,8 +69,8 @@ class bstree_algorithms_base
static node_ptr prev_node(const node_ptr & node)
{
if(is_header(node)){
- return NodeTraits::get_right(node);
- //return maximum(NodeTraits::get_parent(node));
+ //return NodeTraits::get_right(node);
+ return maximum(NodeTraits::get_parent(node));
}
else if(NodeTraits::get_left(node)){
return maximum(NodeTraits::get_left(node));
diff --git a/boost/intrusive/detail/config_begin.hpp b/boost/intrusive/detail/config_begin.hpp
index 36d605d..cef8616 100644
--- a/boost/intrusive/detail/config_begin.hpp
+++ b/boost/intrusive/detail/config_begin.hpp
@@ -38,13 +38,18 @@
#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 : 4522)
+ #pragma warning (disable : 4127) //conditional expression is constant
#pragma warning (disable : 4146)
#pragma warning (disable : 4267) //conversion from 'X' to 'Y', possible loss of data
- #pragma warning (disable : 4127) //conditional expression is constant
- #pragma warning (disable : 4706) //assignment within conditional expression
#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 : 4706) //assignment within conditional expression
+ #pragma warning (disable : 4710) // function not inlined
+ #pragma warning (disable : 4714) // "function": marked as __forceinline not inlined
+ #pragma warning (disable : 4711) // function selected for automatic inline expansion
+ #pragma warning (disable : 4786) // identifier truncated in debug info
+ #pragma warning (disable : 4996) // "function": was declared deprecated
#endif
//#define BOOST_INTRUSIVE_USE_ITERATOR_FACADE
diff --git a/boost/intrusive/detail/default_header_holder.hpp b/boost/intrusive/detail/default_header_holder.hpp
index 5f9cd9a..288f8a0 100644
--- a/boost/intrusive/detail/default_header_holder.hpp
+++ b/boost/intrusive/detail/default_header_holder.hpp
@@ -21,6 +21,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/detail/to_raw_pointer.hpp>
@@ -39,14 +40,14 @@ struct default_header_holder : public NodeTraits::node
default_header_holder() : node() {}
- const_node_ptr get_node() const
+ BOOST_INTRUSIVE_FORCEINLINE const_node_ptr get_node() const
{ return pointer_traits< const_node_ptr >::pointer_to(*static_cast< const node* >(this)); }
- node_ptr get_node()
+ BOOST_INTRUSIVE_FORCEINLINE node_ptr get_node()
{ return pointer_traits< node_ptr >::pointer_to(*static_cast< node* >(this)); }
// (unsafe) downcast used to implement container-from-iterator
- static default_header_holder* get_holder(const node_ptr &p)
+ 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)); }
};
diff --git a/boost/intrusive/detail/ebo_functor_holder.hpp b/boost/intrusive/detail/ebo_functor_holder.hpp
index 9fec5a3..ef278ed 100644
--- a/boost/intrusive/detail/ebo_functor_holder.hpp
+++ b/boost/intrusive/detail/ebo_functor_holder.hpp
@@ -22,6 +22,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/move/utility_core.hpp>
namespace boost {
@@ -165,57 +166,57 @@ class ebo_functor_holder
public:
typedef T functor_type;
- ebo_functor_holder()
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder()
: t_()
{}
- explicit ebo_functor_holder(const T &t)
+ BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(const T &t)
: t_(t)
{}
- explicit ebo_functor_holder(BOOST_RV_REF(T) t)
+ BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(BOOST_RV_REF(T) t)
: t_(::boost::move(t))
{}
template<class Arg1, class Arg2>
- ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2)
: t_(::boost::forward<Arg1>(arg1), ::boost::forward<Arg2>(arg2))
{}
- ebo_functor_holder(const ebo_functor_holder &x)
- : t_(x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(const ebo_functor_holder &x)
+ : t_(x.t_)
{}
- ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x)
: t_(x.t_)
{}
- ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x)
{
this->get() = x.get();
return *this;
}
- ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x)
{
this->get() = ::boost::move(x.get());
return *this;
}
- ebo_functor_holder& operator=(const T &x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(const T &x)
{
this->get() = x;
return *this;
}
- ebo_functor_holder& operator=(BOOST_RV_REF(T) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(T) x)
{
this->get() = ::boost::move(x);
return *this;
}
- T& get(){return t_;}
- const T& get()const{return t_;}
+ BOOST_INTRUSIVE_FORCEINLINE T& get(){return t_;}
+ BOOST_INTRUSIVE_FORCEINLINE const T& get()const{return t_;}
private:
T t_;
@@ -230,58 +231,58 @@ class ebo_functor_holder<T, false>
public:
typedef T functor_type;
- ebo_functor_holder()
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder()
: T()
{}
- explicit ebo_functor_holder(const T &t)
+ BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(const T &t)
: T(t)
{}
- explicit ebo_functor_holder(BOOST_RV_REF(T) t)
+ BOOST_INTRUSIVE_FORCEINLINE explicit ebo_functor_holder(BOOST_RV_REF(T) t)
: T(::boost::move(t))
{}
template<class Arg1, class Arg2>
- ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_FWD_REF(Arg1) arg1, BOOST_FWD_REF(Arg2) arg2)
: T(::boost::forward<Arg1>(arg1), ::boost::forward<Arg2>(arg2))
{}
- ebo_functor_holder(const ebo_functor_holder &x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(const ebo_functor_holder &x)
: T(static_cast<const T&>(x))
{}
- ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder(BOOST_RV_REF(ebo_functor_holder) x)
: T(BOOST_MOVE_BASE(T, x))
{}
- ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_COPY_ASSIGN_REF(ebo_functor_holder) x)
{
const ebo_functor_holder&r = x;
this->get() = x.get();
return *this;
}
- ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(ebo_functor_holder) x)
{
this->get() = ::boost::move(x.get());
return *this;
}
- ebo_functor_holder& operator=(const T &x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(const T &x)
{
this->get() = x;
return *this;
}
- ebo_functor_holder& operator=(BOOST_RV_REF(T) x)
+ BOOST_INTRUSIVE_FORCEINLINE ebo_functor_holder& operator=(BOOST_RV_REF(T) x)
{
this->get() = ::boost::move(x);
return *this;
}
- T& get(){return *this;}
- const T& get()const{return *this;}
+ BOOST_INTRUSIVE_FORCEINLINE T& get(){return *this;}
+ BOOST_INTRUSIVE_FORCEINLINE const T& get()const{return *this;}
};
} //namespace detail {
diff --git a/boost/intrusive/detail/equal_to_value.hpp b/boost/intrusive/detail/equal_to_value.hpp
index c341f48..c5d9e53 100644
--- a/boost/intrusive/detail/equal_to_value.hpp
+++ b/boost/intrusive/detail/equal_to_value.hpp
@@ -21,6 +21,8 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
+
namespace boost {
namespace intrusive {
namespace detail {
@@ -37,7 +39,7 @@ class equal_to_value
: t_(t)
{}
- bool operator()(ConstReference t)const
+ BOOST_INTRUSIVE_FORCEINLINE bool operator()(ConstReference t)const
{ return t_ == t; }
};
diff --git a/boost/intrusive/detail/exception_disposer.hpp b/boost/intrusive/detail/exception_disposer.hpp
index a10d63a..91c5bf3 100644
--- a/boost/intrusive/detail/exception_disposer.hpp
+++ b/boost/intrusive/detail/exception_disposer.hpp
@@ -21,6 +21,8 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
+
namespace boost {
namespace intrusive {
namespace detail {
@@ -39,7 +41,7 @@ class exception_disposer
: cont_(&cont), disp_(disp)
{}
- void release()
+ BOOST_INTRUSIVE_FORCEINLINE void release()
{ cont_ = 0; }
~exception_disposer()
@@ -67,7 +69,7 @@ class exception_array_disposer
: cont_(&cont), disp_(disp), constructed_(constructed)
{}
- void release()
+ BOOST_INTRUSIVE_FORCEINLINE void release()
{ cont_ = 0; }
~exception_array_disposer()
diff --git a/boost/intrusive/detail/has_member_function_callable_with.hpp b/boost/intrusive/detail/has_member_function_callable_with.hpp
index c9a8e7e..2e73305 100644
--- a/boost/intrusive/detail/has_member_function_callable_with.hpp
+++ b/boost/intrusive/detail/has_member_function_callable_with.hpp
@@ -164,13 +164,14 @@ BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEG
{
struct BaseMixin
{
- void BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME();
+ void BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME()
+ {} //Some compilers require the definition or linker errors happen
};
struct Base
: public boost_intrusive_hmfcw::remove_cv<Type>::type, public BaseMixin
{ //Declare the unneeded default constructor as some old compilers wrongly require it with is_convertible
- Base();
+ Base(){}
};
template <typename T, T t> class Helper{};
diff --git a/boost/intrusive/detail/hashtable_node.hpp b/boost/intrusive/detail/hashtable_node.hpp
index 352be28..0471ebe 100644
--- a/boost/intrusive/detail/hashtable_node.hpp
+++ b/boost/intrusive/detail/hashtable_node.hpp
@@ -21,6 +21,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/assert.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/detail/mpl.hpp>
@@ -99,10 +100,10 @@ struct bucket_traits_impl
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_; return *this;
}
- const bucket_ptr &bucket_begin() const
+ BOOST_INTRUSIVE_FORCEINLINE const bucket_ptr &bucket_begin() const
{ return buckets_; }
- size_type bucket_count() const
+ BOOST_INTRUSIVE_FORCEINLINE size_type bucket_count() const
{ return buckets_len_; }
private:
@@ -160,11 +161,11 @@ class hashtable_iterator
typedef iiterator< value_traits, IsConst
, std::forward_iterator_tag> types_t;
public:
- typedef typename types_t::iterator_traits::difference_type difference_type;
- typedef typename types_t::iterator_traits::value_type value_type;
- typedef typename types_t::iterator_traits::pointer pointer;
- typedef typename types_t::iterator_traits::reference reference;
- typedef typename types_t::iterator_traits::iterator_category iterator_category;
+ typedef typename types_t::iterator_type::difference_type difference_type;
+ typedef typename types_t::iterator_type::value_type value_type;
+ typedef typename types_t::iterator_type::pointer pointer;
+ typedef typename types_t::iterator_type::reference reference;
+ typedef typename types_t::iterator_type::iterator_category iterator_category;
private:
typedef typename value_traits::node_traits node_traits;
@@ -189,7 +190,7 @@ class hashtable_iterator
public:
- hashtable_iterator ()
+ BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator ()
: slist_it_() //Value initialization to achieve "null iterators" (N3644)
{}
@@ -202,7 +203,7 @@ class hashtable_iterator
: slist_it_(other.slist_it()), traitsptr_(other.get_bucket_value_traits())
{}
- const siterator &slist_it() const
+ BOOST_INTRUSIVE_FORCEINLINE const siterator &slist_it() const
{ return slist_it_; }
hashtable_iterator<BucketValueTraits, false> unconst() const
@@ -218,28 +219,28 @@ class hashtable_iterator
return result;
}
- friend bool operator== (const hashtable_iterator& i, const hashtable_iterator& i2)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const hashtable_iterator& i, const hashtable_iterator& i2)
{ return i.slist_it_ == i2.slist_it_; }
- friend bool operator!= (const hashtable_iterator& i, const hashtable_iterator& i2)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const hashtable_iterator& i, const hashtable_iterator& i2)
{ return !(i == i2); }
- reference operator*() const
+ BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
{ return *this->operator ->(); }
- pointer operator->() const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
{
return this->priv_value_traits().to_value_ptr
(downcast_bucket(slist_it_.pointed_node()));
}
- const const_bucketvaltraits_ptr &get_bucket_value_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const const_bucketvaltraits_ptr &get_bucket_value_traits() const
{ return traitsptr_; }
- const value_traits &priv_value_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const value_traits &priv_value_traits() const
{ return traitsptr_->priv_value_traits(); }
- const bucket_traits &priv_bucket_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const bucket_traits &priv_bucket_traits() const
{ return traitsptr_->priv_bucket_traits(); }
private:
diff --git a/boost/intrusive/detail/hook_traits.hpp b/boost/intrusive/detail/hook_traits.hpp
index 71f342a..2a16061 100644
--- a/boost/intrusive/detail/hook_traits.hpp
+++ b/boost/intrusive/detail/hook_traits.hpp
@@ -21,6 +21,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/detail/parent_from_member.hpp>
#include <boost/intrusive/link_mode.hpp>
@@ -54,25 +55,25 @@ struct bhtraits_base
typedef node& node_reference;
typedef const node & const_node_reference;
- static pointer to_value_ptr(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n)
{
return pointer_traits<pointer>::pointer_to
(static_cast<reference>(static_cast<node_holder_reference>(*n)));
}
- static const_pointer to_value_ptr(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const const_node_ptr & n)
{
return pointer_traits<const_pointer>::pointer_to
(static_cast<const_reference>(static_cast<const_node_holder_reference>(*n)));
}
- static node_ptr to_node_ptr(reference value)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value)
{
return pointer_traits<node_ptr>::pointer_to
(static_cast<node_reference>(static_cast<node_holder_reference>(value)));
}
- static const_node_ptr to_node_ptr(const_reference value)
+ BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value)
{
return pointer_traits<const_node_ptr>::pointer_to
(static_cast<const_node_reference>(static_cast<const_node_holder_reference>(value)));
@@ -111,26 +112,26 @@ struct mhtraits
static const link_mode_type link_mode = Hook::hooktags::link_mode;
- static node_ptr to_node_ptr(reference value)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value)
{
return pointer_traits<node_ptr>::pointer_to
(static_cast<node_reference>(static_cast<hook_reference>(value.*P)));
}
- static const_node_ptr to_node_ptr(const_reference value)
+ BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value)
{
return pointer_traits<const_node_ptr>::pointer_to
(static_cast<const_node_reference>(static_cast<const_hook_reference>(value.*P)));
}
- static pointer to_value_ptr(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(const node_ptr & n)
{
return pointer_traits<pointer>::pointer_to
(*detail::parent_from_member<T, Hook>
(static_cast<Hook*>(boost::intrusive::detail::to_raw_pointer(n)), P));
}
- static const_pointer to_value_ptr(const const_node_ptr & n)
+ 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>
diff --git a/boost/intrusive/detail/iiterator.hpp b/boost/intrusive/detail/iiterator.hpp
index 5c6721b..5ab1de2 100644
--- a/boost/intrusive/detail/iiterator.hpp
+++ b/boost/intrusive/detail/iiterator.hpp
@@ -21,6 +21,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/iterator.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/intrusive/detail/mpl.hpp>
@@ -70,7 +71,7 @@ struct iiterator
, difference_type
, pointer
, reference
- > iterator_traits;
+ > iterator_type;
typedef typename value_traits_pointers
<ValueTraits>::value_traits_ptr value_traits_ptr;
typedef typename value_traits_pointers
@@ -83,15 +84,15 @@ template<class NodePtr, class StoredPointer, bool StatefulValueTraits = true>
struct iiterator_members
{
- iiterator_members()
+ BOOST_INTRUSIVE_FORCEINLINE iiterator_members()
: nodeptr_()//Value initialization to achieve "null iterators" (N3644)
{}
- iiterator_members(const NodePtr &n_ptr, const StoredPointer &data)
+ BOOST_INTRUSIVE_FORCEINLINE iiterator_members(const NodePtr &n_ptr, const StoredPointer &data)
: nodeptr_(n_ptr), ptr_(data)
{}
- StoredPointer get_ptr() const
+ BOOST_INTRUSIVE_FORCEINLINE StoredPointer get_ptr() const
{ return ptr_; }
NodePtr nodeptr_;
@@ -101,15 +102,15 @@ struct iiterator_members
template<class NodePtr, class StoredPointer>
struct iiterator_members<NodePtr, StoredPointer, false>
{
- iiterator_members()
+ BOOST_INTRUSIVE_FORCEINLINE iiterator_members()
: nodeptr_()//Value initialization to achieve "null iterators" (N3644)
{}
- iiterator_members(const NodePtr &n_ptr, const StoredPointer &)
+ BOOST_INTRUSIVE_FORCEINLINE iiterator_members(const NodePtr &n_ptr, const StoredPointer &)
: nodeptr_(n_ptr)
{}
- StoredPointer get_ptr() const
+ BOOST_INTRUSIVE_FORCEINLINE StoredPointer get_ptr() const
{ return StoredPointer(); }
NodePtr nodeptr_;
diff --git a/boost/intrusive/detail/iterator.hpp b/boost/intrusive/detail/iterator.hpp
index 9f0fe60..2ae6abb 100644
--- a/boost/intrusive/detail/iterator.hpp
+++ b/boost/intrusive/detail/iterator.hpp
@@ -23,6 +23,7 @@
#include <cstddef>
#include <boost/intrusive/detail/std_fwd.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/move/detail/iterator_traits.hpp>
#include <boost/move/detail/meta_utils_core.hpp>
@@ -34,14 +35,14 @@ using boost::movelib::iterator_traits;
////////////////////
// iterator
////////////////////
-template<class Category, class T, class Distance, class Pointer = T*, class Reference = T&>
+template<class Category, class T, class Difference, class Pointer, class Reference>
struct iterator
{
- typedef Category iterator_category;
- typedef T value_type;
- typedef Distance difference_type;
- typedef Pointer pointer;
- typedef Reference reference;
+ typedef Category iterator_category;
+ typedef T value_type;
+ typedef Difference difference_type;
+ typedef Pointer pointer;
+ typedef Reference reference;
};
////////////////////////////////////////
@@ -83,7 +84,7 @@ struct iterator_disable_if_tag_difference_type
////////////////////
// advance
////////////////////
-template<class InputIt, class Distance> inline
+template<class InputIt, class Distance>
typename iterator_enable_if_tag<InputIt, std::input_iterator_tag>::type
iterator_advance(InputIt& it, Distance n)
{
@@ -91,7 +92,7 @@ typename iterator_enable_if_tag<InputIt, std::input_iterator_tag>::type
++it;
}
-template<class InputIt, class Distance> inline
+template<class InputIt, class Distance>
typename iterator_enable_if_tag<InputIt, std::forward_iterator_tag>::type
iterator_advance(InputIt& it, Distance n)
{
@@ -99,7 +100,7 @@ typename iterator_enable_if_tag<InputIt, std::forward_iterator_tag>::type
++it;
}
-template<class InputIt, class Distance> inline
+template<class InputIt, class Distance>
typename iterator_enable_if_tag<InputIt, std::bidirectional_iterator_tag>::type
iterator_advance(InputIt& it, Distance n)
{
@@ -109,8 +110,8 @@ typename iterator_enable_if_tag<InputIt, std::bidirectional_iterator_tag>::type
--it;
}
-template<class InputIt, class Distance> inline
-typename iterator_enable_if_tag<InputIt, std::random_access_iterator_tag>::type
+template<class InputIt, class Distance>
+BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag<InputIt, std::random_access_iterator_tag>::type
iterator_advance(InputIt& it, Distance n)
{
it += n;
@@ -132,8 +133,8 @@ typename iterator_disable_if_tag_difference_type
return off;
}
-template<class InputIt> inline
-typename iterator_enable_if_tag_difference_type
+template<class InputIt>
+BOOST_INTRUSIVE_FORCEINLINE typename iterator_enable_if_tag_difference_type
<InputIt, std::random_access_iterator_tag>::type
iterator_distance(InputIt first, InputIt last)
{
@@ -142,11 +143,11 @@ typename iterator_enable_if_tag_difference_type
}
template<class I>
-typename iterator_traits<I>::pointer iterator_arrow_result(const I &i)
+BOOST_INTRUSIVE_FORCEINLINE typename iterator_traits<I>::pointer iterator_arrow_result(const I &i)
{ return i.operator->(); }
template<class T>
-T * iterator_arrow_result(T *p)
+BOOST_INTRUSIVE_FORCEINLINE T * iterator_arrow_result(T *p)
{ return p; }
} //namespace intrusive
diff --git a/boost/intrusive/detail/list_iterator.hpp b/boost/intrusive/detail/list_iterator.hpp
index 6af4841..6c5f161 100644
--- a/boost/intrusive/detail/list_iterator.hpp
+++ b/boost/intrusive/detail/list_iterator.hpp
@@ -22,6 +22,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/std_fwd.hpp>
#include <boost/intrusive/detail/iiterator.hpp>
#include <boost/intrusive/detail/mpl.hpp>
@@ -48,80 +49,80 @@ class list_iterator
typedef typename types_t::const_value_traits_ptr const_value_traits_ptr;
public:
- typedef typename types_t::iterator_traits::difference_type difference_type;
- typedef typename types_t::iterator_traits::value_type value_type;
- typedef typename types_t::iterator_traits::pointer pointer;
- typedef typename types_t::iterator_traits::reference reference;
- typedef typename types_t::iterator_traits::iterator_category iterator_category;
+ typedef typename types_t::iterator_type::difference_type difference_type;
+ typedef typename types_t::iterator_type::value_type value_type;
+ typedef typename types_t::iterator_type::pointer pointer;
+ typedef typename types_t::iterator_type::reference reference;
+ typedef typename types_t::iterator_type::iterator_category iterator_category;
- list_iterator()
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator()
{}
- explicit list_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
+ BOOST_INTRUSIVE_FORCEINLINE explicit list_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
: members_(nodeptr, traits_ptr)
{}
- list_iterator(list_iterator<ValueTraits, false> const& other)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator(list_iterator<ValueTraits, false> const& other)
: members_(other.pointed_node(), other.get_value_traits())
{}
- const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
{ return members_.nodeptr_; }
- list_iterator &operator=(const node_ptr &node)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
{ members_.nodeptr_ = node; return static_cast<list_iterator&>(*this); }
- const_value_traits_ptr get_value_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
{ return members_.get_ptr(); }
public:
- list_iterator& operator++()
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator& operator++()
{
node_ptr p = node_traits::get_next(members_.nodeptr_);
members_.nodeptr_ = p;
return static_cast<list_iterator&> (*this);
}
- list_iterator operator++(int)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator operator++(int)
{
list_iterator result (*this);
members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
return result;
}
- list_iterator& operator--()
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator& operator--()
{
members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
return static_cast<list_iterator&> (*this);
}
- list_iterator operator--(int)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator operator--(int)
{
list_iterator result (*this);
members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
return result;
}
- friend bool operator== (const list_iterator& l, const list_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const list_iterator& l, const list_iterator& r)
{ return l.pointed_node() == r.pointed_node(); }
- friend bool operator!= (const list_iterator& l, const list_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const list_iterator& l, const list_iterator& r)
{ return !(l == r); }
- reference operator*() const
+ BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
{ return *operator->(); }
- pointer operator->() const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
list_iterator<ValueTraits, false> unconst() const
{ return list_iterator<ValueTraits, false>(this->pointed_node(), this->get_value_traits()); }
private:
- pointer operator_arrow(detail::false_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const
{ return ValueTraits::to_value_ptr(members_.nodeptr_); }
- pointer operator_arrow(detail::true_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const
{ return this->get_value_traits()->to_value_ptr(members_.nodeptr_); }
iiterator_members<node_ptr, const_value_traits_ptr, stateful_value_traits> members_;
diff --git a/boost/intrusive/detail/list_node.hpp b/boost/intrusive/detail/list_node.hpp
index f740e54..c3b4847 100644
--- a/boost/intrusive/detail/list_node.hpp
+++ b/boost/intrusive/detail/list_node.hpp
@@ -22,6 +22,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_rebind.hpp>
namespace boost {
@@ -46,22 +47,22 @@ struct list_node_traits
typedef typename node::node_ptr node_ptr;
typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
- static node_ptr get_previous(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const const_node_ptr & n)
{ return n->prev_; }
- static node_ptr get_previous(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_previous(const node_ptr & n)
{ return n->prev_; }
- static void set_previous(const node_ptr & n, const node_ptr & prev)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_previous(const node_ptr & n, const node_ptr & prev)
{ n->prev_ = prev; }
- static node_ptr get_next(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
{ return n->next_; }
- static node_ptr get_next(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
{ return n->next_; }
- static void set_next(const node_ptr & n, const node_ptr & next)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
{ n->next_ = next; }
};
diff --git a/boost/intrusive/detail/parent_from_member.hpp b/boost/intrusive/detail/parent_from_member.hpp
index 8701c3f..275229a 100644
--- a/boost/intrusive/detail/parent_from_member.hpp
+++ b/boost/intrusive/detail/parent_from_member.hpp
@@ -21,9 +21,10 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <cstddef>
-#if defined(BOOST_MSVC) || ((defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && defined(BOOST_INTEL))
+#if defined(_MSC_VER)
#define BOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER
#include <boost/static_assert.hpp>
#endif
@@ -33,7 +34,7 @@ namespace intrusive {
namespace detail {
template<class Parent, class Member>
-inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member)
+BOOST_INTRUSIVE_FORCEINLINE std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member)
{
//The implementation of a pointer to member is compiler dependent.
#if defined(BOOST_INTRUSIVE_MSVC_ABI_PTR_TO_MEMBER)
@@ -88,7 +89,7 @@ inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_t
}
template<class Parent, class Member>
-inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member)
+BOOST_INTRUSIVE_FORCEINLINE Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member)
{
return static_cast<Parent*>
(
@@ -100,7 +101,7 @@ inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_
}
template<class Parent, class Member>
-inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
+BOOST_INTRUSIVE_FORCEINLINE const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
{
return static_cast<const Parent*>
(
diff --git a/boost/intrusive/detail/rbtree_node.hpp b/boost/intrusive/detail/rbtree_node.hpp
index c436439..68f4bdf 100644
--- a/boost/intrusive/detail/rbtree_node.hpp
+++ b/boost/intrusive/detail/rbtree_node.hpp
@@ -23,6 +23,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_rebind.hpp>
#include <boost/intrusive/rbtree_algorithms.hpp>
#include <boost/intrusive/pointer_plus_bits.hpp>
@@ -73,46 +74,46 @@ struct default_rbtree_node_traits_impl
typedef typename node::color color;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return n->parent_; }
- static node_ptr get_parent(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
{ return n->parent_; }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ n->parent_ = p; }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->left_; }
- static node_ptr get_left(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
{ return n->left_; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->left_ = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->right_; }
- static node_ptr get_right(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
{ return n->right_; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->right_ = r; }
- static color get_color(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
{ return n->color_; }
- static color get_color(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static color get_color(const node_ptr & n)
{ return n->color_; }
- static void set_color(const node_ptr & n, color c)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c)
{ n->color_ = c; }
- static color black()
+ BOOST_INTRUSIVE_FORCEINLINE static color black()
{ return node::black_t; }
- static color red()
+ BOOST_INTRUSIVE_FORCEINLINE static color red()
{ return node::red_t; }
};
@@ -129,46 +130,46 @@ struct compact_rbtree_node_traits_impl
typedef typename node::color color;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return ptr_bit::get_pointer(n->parent_); }
- static node_ptr get_parent(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
{ return ptr_bit::get_pointer(n->parent_); }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ ptr_bit::set_pointer(n->parent_, p); }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->left_; }
- static node_ptr get_left(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
{ return n->left_; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->left_ = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->right_; }
- static node_ptr get_right(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
{ return n->right_; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const node_ptr & r)
{ n->right_ = r; }
- static color get_color(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static color get_color(const const_node_ptr & n)
{ return (color)ptr_bit::get_bits(n->parent_); }
- static color get_color(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static color get_color(const node_ptr & n)
{ return (color)ptr_bit::get_bits(n->parent_); }
- static void set_color(const node_ptr & n, color c)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_color(const node_ptr & n, color c)
{ ptr_bit::set_bits(n->parent_, c != 0); }
- static color black()
+ BOOST_INTRUSIVE_FORCEINLINE static color black()
{ return node::black_t; }
- static color red()
+ BOOST_INTRUSIVE_FORCEINLINE static color red()
{ return node::red_t; }
};
diff --git a/boost/intrusive/detail/reverse_iterator.hpp b/boost/intrusive/detail/reverse_iterator.hpp
index 552e8f4..57631fe 100644
--- a/boost/intrusive/detail/reverse_iterator.hpp
+++ b/boost/intrusive/detail/reverse_iterator.hpp
@@ -43,12 +43,16 @@ class reverse_iterator
reverse_iterator()
: m_current() //Value initialization to achieve "null iterators" (N3644)
- {}
+ {}
explicit reverse_iterator(It r)
: m_current(r)
{}
+ reverse_iterator(const reverse_iterator& r)
+ : m_current(r.base())
+ {}
+
template<class OtherIt>
reverse_iterator( const reverse_iterator<OtherIt>& r
, typename boost::intrusive::detail::enable_if_convertible<OtherIt, It>::type* =0
@@ -56,6 +60,9 @@ class reverse_iterator
: m_current(r.base())
{}
+ reverse_iterator & operator=( const reverse_iterator& r)
+ { m_current = r.base(); return *this; }
+
template<class OtherIt>
typename boost::intrusive::detail::enable_if_convertible<OtherIt, It, reverse_iterator &>::type
operator=( const reverse_iterator<OtherIt>& r)
@@ -65,20 +72,34 @@ class reverse_iterator
{ return m_current; }
reference operator*() const
- { It temp(m_current); --temp; return *temp; }
+ {
+ It temp(m_current);
+ --temp;
+ reference r = *temp;
+ return r;
+ }
pointer operator->() const
- { It temp(m_current); --temp; return iterator_arrow_result(temp); }
+ {
+ It temp(m_current);
+ --temp;
+ return iterator_arrow_result(temp);
+ }
reference operator[](difference_type off) const
- { return this->m_current[-off - 1]; }
+ {
+ return this->m_current[-off - 1];
+ }
reverse_iterator& operator++()
- { --m_current; return *this; }
+ {
+ --m_current;
+ return *this;
+ }
reverse_iterator operator++(int)
{
- reverse_iterator temp = *this;
+ reverse_iterator temp((*this));
--m_current;
return temp;
}
@@ -91,7 +112,7 @@ class reverse_iterator
reverse_iterator operator--(int)
{
- reverse_iterator temp(*this);
+ reverse_iterator temp((*this));
++m_current;
return temp;
}
@@ -117,17 +138,17 @@ class reverse_iterator
reverse_iterator& operator+=(difference_type off)
{ m_current -= off; return *this; }
+ reverse_iterator& operator-=(difference_type off)
+ { m_current += off; return *this; }
+
friend reverse_iterator operator+(reverse_iterator l, difference_type off)
- { l.m_current -= off; return l; }
+ { return (l += off); }
friend reverse_iterator operator+(difference_type off, reverse_iterator r)
{ return (r += off); }
- reverse_iterator& operator-=(difference_type off)
- { m_current += off; return *this; }
-
friend reverse_iterator operator-(reverse_iterator l, difference_type off)
- { l.m_current += off; return l; }
+ { return (l-= off); }
friend difference_type operator-(const reverse_iterator& l, const reverse_iterator& r)
{ return r.m_current - l.m_current; }
diff --git a/boost/intrusive/detail/size_holder.hpp b/boost/intrusive/detail/size_holder.hpp
index de1933e..9802ac3 100644
--- a/boost/intrusive/detail/size_holder.hpp
+++ b/boost/intrusive/detail/size_holder.hpp
@@ -21,6 +21,8 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
+
namespace boost {
namespace intrusive {
namespace detail {
@@ -31,22 +33,22 @@ struct size_holder
static const bool constant_time_size = ConstantSize;
typedef SizeType size_type;
- SizeType get_size() const
+ BOOST_INTRUSIVE_FORCEINLINE SizeType get_size() const
{ return size_; }
- void set_size(SizeType size)
+ BOOST_INTRUSIVE_FORCEINLINE void set_size(SizeType size)
{ size_ = size; }
- void decrement()
+ BOOST_INTRUSIVE_FORCEINLINE void decrement()
{ --size_; }
- void increment()
+ BOOST_INTRUSIVE_FORCEINLINE void increment()
{ ++size_; }
- void increase(SizeType n)
+ BOOST_INTRUSIVE_FORCEINLINE void increase(SizeType n)
{ size_ += n; }
- void decrease(SizeType n)
+ BOOST_INTRUSIVE_FORCEINLINE void decrease(SizeType n)
{ size_ -= n; }
SizeType size_;
@@ -58,22 +60,22 @@ struct size_holder<false, SizeType, Tag>
static const bool constant_time_size = false;
typedef SizeType size_type;
- size_type get_size() const
+ BOOST_INTRUSIVE_FORCEINLINE size_type get_size() const
{ return 0; }
- void set_size(size_type)
+ BOOST_INTRUSIVE_FORCEINLINE void set_size(size_type)
{}
- void decrement()
+ BOOST_INTRUSIVE_FORCEINLINE void decrement()
{}
- void increment()
+ BOOST_INTRUSIVE_FORCEINLINE void increment()
{}
- void increase(SizeType)
+ BOOST_INTRUSIVE_FORCEINLINE void increase(SizeType)
{}
- void decrease(SizeType)
+ BOOST_INTRUSIVE_FORCEINLINE void decrease(SizeType)
{}
};
diff --git a/boost/intrusive/detail/slist_iterator.hpp b/boost/intrusive/detail/slist_iterator.hpp
index 1699064..63ce5c3 100644
--- a/boost/intrusive/detail/slist_iterator.hpp
+++ b/boost/intrusive/detail/slist_iterator.hpp
@@ -23,6 +23,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/std_fwd.hpp>
#include <boost/intrusive/detail/iiterator.hpp>
#include <boost/intrusive/detail/mpl.hpp>
@@ -50,67 +51,67 @@ class slist_iterator
typedef typename types_t::const_value_traits_ptr const_value_traits_ptr;
public:
- typedef typename types_t::iterator_traits::difference_type difference_type;
- typedef typename types_t::iterator_traits::value_type value_type;
- typedef typename types_t::iterator_traits::pointer pointer;
- typedef typename types_t::iterator_traits::reference reference;
- typedef typename types_t::iterator_traits::iterator_category iterator_category;
+ typedef typename types_t::iterator_type::difference_type difference_type;
+ typedef typename types_t::iterator_type::value_type value_type;
+ typedef typename types_t::iterator_type::pointer pointer;
+ typedef typename types_t::iterator_type::reference reference;
+ typedef typename types_t::iterator_type::iterator_category iterator_category;
- slist_iterator()
+ BOOST_INTRUSIVE_FORCEINLINE slist_iterator()
{}
- explicit slist_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
+ BOOST_INTRUSIVE_FORCEINLINE explicit slist_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
: members_(nodeptr, traits_ptr)
{}
- slist_iterator(slist_iterator<ValueTraits, false> const& other)
+ BOOST_INTRUSIVE_FORCEINLINE slist_iterator(slist_iterator<ValueTraits, false> const& other)
: members_(other.pointed_node(), other.get_value_traits())
{}
- const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
{ return members_.nodeptr_; }
- slist_iterator &operator=(const node_ptr &node)
+ BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const node_ptr &node)
{ members_.nodeptr_ = node; return static_cast<slist_iterator&>(*this); }
- const_value_traits_ptr get_value_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
{ return members_.get_ptr(); }
public:
- slist_iterator& operator++()
+ BOOST_INTRUSIVE_FORCEINLINE slist_iterator& operator++()
{
members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
return static_cast<slist_iterator&> (*this);
}
- slist_iterator operator++(int)
+ BOOST_INTRUSIVE_FORCEINLINE slist_iterator operator++(int)
{
slist_iterator result (*this);
members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
return result;
}
- friend bool operator== (const slist_iterator& l, const slist_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const slist_iterator& l, const slist_iterator& r)
{ return l.pointed_node() == r.pointed_node(); }
- friend bool operator!= (const slist_iterator& l, const slist_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const slist_iterator& l, const slist_iterator& r)
{ return !(l == r); }
- reference operator*() const
+ BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
{ return *operator->(); }
- pointer operator->() const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
- slist_iterator<ValueTraits, false> unconst() const
+ BOOST_INTRUSIVE_FORCEINLINE slist_iterator<ValueTraits, false> unconst() const
{ return slist_iterator<ValueTraits, false>(this->pointed_node(), this->get_value_traits()); }
private:
- pointer operator_arrow(detail::false_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const
{ return ValueTraits::to_value_ptr(members_.nodeptr_); }
- pointer operator_arrow(detail::true_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const
{ return this->get_value_traits()->to_value_ptr(members_.nodeptr_); }
iiterator_members<node_ptr, const_value_traits_ptr, stateful_value_traits> members_;
diff --git a/boost/intrusive/detail/slist_node.hpp b/boost/intrusive/detail/slist_node.hpp
index 3d5fbfb..848764e 100644
--- a/boost/intrusive/detail/slist_node.hpp
+++ b/boost/intrusive/detail/slist_node.hpp
@@ -23,6 +23,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_rebind.hpp>
namespace boost {
@@ -45,13 +46,13 @@ struct slist_node_traits
typedef typename node::node_ptr node_ptr;
typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
- static node_ptr get_next(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const const_node_ptr & n)
{ return n->next_; }
- static node_ptr get_next(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_next(const node_ptr & n)
{ return n->next_; }
- static void set_next(const node_ptr & n, const node_ptr & next)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_next(const node_ptr & n, const node_ptr & next)
{ n->next_ = next; }
};
diff --git a/boost/intrusive/detail/to_raw_pointer.hpp b/boost/intrusive/detail/to_raw_pointer.hpp
index 387f63f..8ea8849 100644
--- a/boost/intrusive/detail/to_raw_pointer.hpp
+++ b/boost/intrusive/detail/to_raw_pointer.hpp
@@ -22,6 +22,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/pointer_element.hpp>
namespace boost {
@@ -29,11 +30,11 @@ namespace intrusive {
namespace detail {
template <class T>
-inline T* to_raw_pointer(T* p)
+BOOST_INTRUSIVE_FORCEINLINE T* to_raw_pointer(T* p)
{ return p; }
template <class Pointer>
-inline typename boost::intrusive::pointer_element<Pointer>::type*
+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->()); }
diff --git a/boost/intrusive/detail/transform_iterator.hpp b/boost/intrusive/detail/transform_iterator.hpp
index 5e3b1a7..0a71575 100644
--- a/boost/intrusive/detail/transform_iterator.hpp
+++ b/boost/intrusive/detail/transform_iterator.hpp
@@ -22,6 +22,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/detail/iterator.hpp>
@@ -32,11 +33,11 @@ namespace detail {
template <class PseudoReference>
struct operator_arrow_proxy
{
- operator_arrow_proxy(const PseudoReference &px)
+ BOOST_INTRUSIVE_FORCEINLINE operator_arrow_proxy(const PseudoReference &px)
: m_value(px)
{}
- PseudoReference* operator->() const { return &m_value; }
+ BOOST_INTRUSIVE_FORCEINLINE PseudoReference* operator->() const { return &m_value; }
// This function is needed for MWCW and BCC, which won't call operator->
// again automatically per 13.3.1.2 para 8
// operator T*() const { return &m_value; }
@@ -46,11 +47,11 @@ struct operator_arrow_proxy
template <class T>
struct operator_arrow_proxy<T&>
{
- operator_arrow_proxy(T &px)
+ BOOST_INTRUSIVE_FORCEINLINE operator_arrow_proxy(T &px)
: m_value(px)
{}
- T* operator->() const { return &m_value; }
+ BOOST_INTRUSIVE_FORCEINLINE T* operator->() const { return &m_value; }
// This function is needed for MWCW and BCC, which won't call operator->
// again automatically per 13.3.1.2 para 8
// operator T*() const { return &m_value; }
@@ -75,53 +76,53 @@ class transform_iterator
: members_()
{}
- Iterator get_it() const
+ BOOST_INTRUSIVE_FORCEINLINE Iterator get_it() const
{ return members_.m_it; }
//Constructors
- transform_iterator& operator++()
+ BOOST_INTRUSIVE_FORCEINLINE transform_iterator& operator++()
{ increment(); return *this; }
- transform_iterator operator++(int)
+ BOOST_INTRUSIVE_FORCEINLINE transform_iterator operator++(int)
{
transform_iterator result (*this);
increment();
return result;
}
- friend bool operator== (const transform_iterator& i, const transform_iterator& i2)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const transform_iterator& i, const transform_iterator& i2)
{ return i.equal(i2); }
- friend bool operator!= (const transform_iterator& i, const transform_iterator& i2)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const transform_iterator& i, const transform_iterator& i2)
{ return !(i == i2); }
- friend typename Iterator::difference_type operator- (const transform_iterator& i, const transform_iterator& i2)
+ BOOST_INTRUSIVE_FORCEINLINE friend typename Iterator::difference_type operator- (const transform_iterator& i, const transform_iterator& i2)
{ return i2.distance_to(i); }
//Arithmetic
transform_iterator& operator+=(typename Iterator::difference_type off)
{ this->advance(off); return *this; }
- transform_iterator operator+(typename Iterator::difference_type off) const
+ BOOST_INTRUSIVE_FORCEINLINE transform_iterator operator+(typename Iterator::difference_type off) const
{
transform_iterator other(*this);
other.advance(off);
return other;
}
- friend transform_iterator operator+(typename Iterator::difference_type off, const transform_iterator& right)
+ BOOST_INTRUSIVE_FORCEINLINE friend transform_iterator operator+(typename Iterator::difference_type off, const transform_iterator& right)
{ return right + off; }
- transform_iterator& operator-=(typename Iterator::difference_type off)
+ BOOST_INTRUSIVE_FORCEINLINE transform_iterator& operator-=(typename Iterator::difference_type off)
{ this->advance(-off); return *this; }
- transform_iterator operator-(typename Iterator::difference_type off) const
+ BOOST_INTRUSIVE_FORCEINLINE transform_iterator operator-(typename Iterator::difference_type off) const
{ return *this + (-off); }
- typename UnaryFunction::result_type operator*() const
+ BOOST_INTRUSIVE_FORCEINLINE typename UnaryFunction::result_type operator*() const
{ return dereference(); }
- operator_arrow_proxy<typename UnaryFunction::result_type>
+ BOOST_INTRUSIVE_FORCEINLINE operator_arrow_proxy<typename UnaryFunction::result_type>
operator->() const
{ return operator_arrow_proxy<typename UnaryFunction::result_type>(dereference()); }
@@ -129,27 +130,27 @@ class transform_iterator
struct members
: UnaryFunction
{
- members(const Iterator &it, const UnaryFunction &f)
+ BOOST_INTRUSIVE_FORCEINLINE members(const Iterator &it, const UnaryFunction &f)
: UnaryFunction(f), m_it(it)
{}
- members()
+ BOOST_INTRUSIVE_FORCEINLINE members()
{}
Iterator m_it;
} members_;
- void increment()
+ BOOST_INTRUSIVE_FORCEINLINE void increment()
{ ++members_.m_it; }
- void decrement()
+ BOOST_INTRUSIVE_FORCEINLINE void decrement()
{ --members_.m_it; }
- bool equal(const transform_iterator &other) const
+ BOOST_INTRUSIVE_FORCEINLINE bool equal(const transform_iterator &other) const
{ return members_.m_it == other.members_.m_it; }
- bool less(const transform_iterator &other) const
+ BOOST_INTRUSIVE_FORCEINLINE bool less(const transform_iterator &other) const
{ return other.members_.m_it < members_.m_it; }
typename UnaryFunction::result_type dereference() const
diff --git a/boost/intrusive/detail/tree_iterator.hpp b/boost/intrusive/detail/tree_iterator.hpp
index 4985c6c..f36a1f2 100644
--- a/boost/intrusive/detail/tree_iterator.hpp
+++ b/boost/intrusive/detail/tree_iterator.hpp
@@ -22,6 +22,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/std_fwd.hpp>
#include <boost/intrusive/detail/iiterator.hpp>
#include <boost/intrusive/detail/bstree_algorithms_base.hpp>
@@ -56,27 +57,27 @@ class tree_iterator
typedef void (tree_iterator::*unspecified_bool_type)() const;
public:
- typedef typename types_t::iterator_traits::difference_type difference_type;
- typedef typename types_t::iterator_traits::value_type value_type;
- typedef typename types_t::iterator_traits::pointer pointer;
- typedef typename types_t::iterator_traits::reference reference;
- typedef typename types_t::iterator_traits::iterator_category iterator_category;
+ typedef typename types_t::iterator_type::difference_type difference_type;
+ typedef typename types_t::iterator_type::value_type value_type;
+ typedef typename types_t::iterator_type::pointer pointer;
+ typedef typename types_t::iterator_type::reference reference;
+ typedef typename types_t::iterator_type::iterator_category iterator_category;
- tree_iterator()
+ BOOST_INTRUSIVE_FORCEINLINE tree_iterator()
{}
- explicit tree_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
+ BOOST_INTRUSIVE_FORCEINLINE explicit tree_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
: members_(nodeptr, traits_ptr)
{}
- tree_iterator(tree_iterator<value_traits, false> const& other)
+ BOOST_INTRUSIVE_FORCEINLINE tree_iterator(tree_iterator<value_traits, false> const& other)
: members_(other.pointed_node(), other.get_value_traits())
{}
- const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
{ return members_.nodeptr_; }
- tree_iterator &operator=(const node_ptr &nodeptr)
+ BOOST_INTRUSIVE_FORCEINLINE tree_iterator &operator=(const node_ptr &nodeptr)
{ members_.nodeptr_ = nodeptr; return static_cast<tree_iterator&>(*this); }
public:
@@ -106,43 +107,43 @@ class tree_iterator
return result;
}
- tree_iterator& go_left()
+ BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_left()
{
members_.nodeptr_ = node_traits::get_left(members_.nodeptr_);
return static_cast<tree_iterator&> (*this);
}
- tree_iterator& go_right()
+ BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_right()
{
members_.nodeptr_ = node_traits::get_right(members_.nodeptr_);
return static_cast<tree_iterator&> (*this);
}
- tree_iterator& go_parent()
+ BOOST_INTRUSIVE_FORCEINLINE tree_iterator& go_parent()
{
members_.nodeptr_ = node_traits::get_parent(members_.nodeptr_);
return static_cast<tree_iterator&> (*this);
}
- operator unspecified_bool_type() const
+ BOOST_INTRUSIVE_FORCEINLINE operator unspecified_bool_type() const
{ return members_.nodeptr_ ? &tree_iterator::unspecified_bool_type_func : 0; }
- bool operator! () const
+ BOOST_INTRUSIVE_FORCEINLINE bool operator! () const
{ return !members_.nodeptr_; }
- friend bool operator== (const tree_iterator& l, const tree_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const tree_iterator& l, const tree_iterator& r)
{ return l.pointed_node() == r.pointed_node(); }
- friend bool operator!= (const tree_iterator& l, const tree_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const tree_iterator& l, const tree_iterator& r)
{ return !(l == r); }
- reference operator*() const
+ BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
{ return *operator->(); }
- pointer operator->() const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
- const_value_traits_ptr get_value_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
{ return members_.get_ptr(); }
tree_iterator end_iterator_from_it() const
@@ -154,10 +155,10 @@ class tree_iterator
{ return tree_iterator<value_traits, false>(this->pointed_node(), this->get_value_traits()); }
private:
- pointer operator_arrow(detail::false_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const
{ return ValueTraits::to_value_ptr(members_.nodeptr_); }
- pointer operator_arrow(detail::true_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const
{ return this->get_value_traits()->to_value_ptr(members_.nodeptr_); }
iiterator_members<node_ptr, const_value_traits_ptr, stateful_value_traits> members_;
diff --git a/boost/intrusive/detail/tree_node.hpp b/boost/intrusive/detail/tree_node.hpp
index e36a82a..606fbc8 100644
--- a/boost/intrusive/detail/tree_node.hpp
+++ b/boost/intrusive/detail/tree_node.hpp
@@ -22,6 +22,7 @@
#endif
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/pointer_rebind.hpp>
namespace boost {
@@ -43,31 +44,31 @@ struct tree_node_traits
typedef typename node::node_ptr node_ptr;
typedef typename pointer_rebind<VoidPointer, const node>::type const_node_ptr;
- static node_ptr get_parent(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const const_node_ptr & n)
{ return n->parent_; }
- static node_ptr get_parent(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_parent(const node_ptr & n)
{ return n->parent_; }
- static void set_parent(const node_ptr & n, const node_ptr & p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_parent(const node_ptr & n, const node_ptr & p)
{ n->parent_ = p; }
- static node_ptr get_left(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const const_node_ptr & n)
{ return n->left_; }
- static node_ptr get_left(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_left(const node_ptr & n)
{ return n->left_; }
- static void set_left(const node_ptr & n, const node_ptr & l)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_left(const node_ptr & n, const node_ptr & l)
{ n->left_ = l; }
- static node_ptr get_right(const const_node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const const_node_ptr & n)
{ return n->right_; }
- static node_ptr get_right(const node_ptr & n)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr get_right(const node_ptr & n)
{ return n->right_; }
- static void set_right(const node_ptr & n, const node_ptr & r)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_right(const node_ptr & n, const 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 dc55444..810d894 100644
--- a/boost/intrusive/detail/tree_value_compare.hpp
+++ b/boost/intrusive/detail/tree_value_compare.hpp
@@ -18,6 +18,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/detail/ebo_functor_holder.hpp>
@@ -53,10 +54,10 @@ struct tree_value_compare
tree_value_compare &operator=(const key_compare &x)
{ this->base_t::get() = x; return *this; }
- const key_compare &key_comp() const
+ BOOST_INTRUSIVE_FORCEINLINE const key_compare &key_comp() const
{ return static_cast<const key_compare &>(*this); }
- key_compare &key_comp()
+ BOOST_INTRUSIVE_FORCEINLINE key_compare &key_comp()
{ return static_cast<key_compare &>(*this); }
template<class U>
@@ -70,16 +71,16 @@ struct tree_value_compare
{ return key; }
template<class U>
- const key_type & key_forward
+ BOOST_INTRUSIVE_FORCEINLINE const key_type & key_forward
(const U &key, typename boost::intrusive::detail::disable_if<is_key<U> >::type* = 0) const
{ return KeyOfValue()(key); }
template<class KeyType, class KeyType2>
- bool operator()(const KeyType &key1, const KeyType2 &key2) const
+ BOOST_INTRUSIVE_FORCEINLINE bool operator()(const KeyType &key1, const KeyType2 &key2) const
{ return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); }
template<class KeyType, class KeyType2>
- bool operator()(const KeyType &key1, const KeyType2 &key2)
+ BOOST_INTRUSIVE_FORCEINLINE bool operator()(const KeyType &key1, const KeyType2 &key2)
{ return key_compare::operator()(this->key_forward(key1), this->key_forward(key2)); }
};
diff --git a/boost/intrusive/detail/workaround.hpp b/boost/intrusive/detail/workaround.hpp
index b73f4ef..7a9ac48 100644
--- a/boost/intrusive/detail/workaround.hpp
+++ b/boost/intrusive/detail/workaround.hpp
@@ -34,5 +34,17 @@
#define BOOST_INTRUSIVE_I ,
#define BOOST_INTRUSIVE_DOCIGN(T1) T1
+#define BOOST_INTRUSIVE_DISABLE_FORCEINLINE
+
+#if defined(BOOST_INTRUSIVE_DISABLE_FORCEINLINE)
+ #define BOOST_INTRUSIVE_FORCEINLINE inline
+#elif defined(BOOST_INTRUSIVE_FORCEINLINE_IS_BOOST_FORCELINE)
+ #define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
+#elif defined(BOOST_MSVC) && defined(_DEBUG)
+ //"__forceinline" and MSVC seems to have some bugs in debug mode
+ #define BOOST_INTRUSIVE_FORCEINLINE inline
+#else
+ #define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
+#endif
#endif //#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
diff --git a/boost/intrusive/hashtable.hpp b/boost/intrusive/hashtable.hpp
index 125330f..f9074c0 100644
--- a/boost/intrusive/hashtable.hpp
+++ b/boost/intrusive/hashtable.hpp
@@ -2057,8 +2057,7 @@ class hashtable_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), this->priv_hasher(), this->priv_equal(), commit_data);
+ std::pair<iterator, bool> ret = this->insert_unique_check(key_of_value()(value), commit_data);
if(ret.second){
ret.first = this->insert_unique_commit(value, commit_data);
}
@@ -2134,6 +2133,37 @@ class hashtable_impl
, pos == this->priv_invalid_local_it());
}
+ //! <b>Effects</b>: Checks if a value can be inserted in the unordered_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hasher or key_compare throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the hash or the equality is much cheaper to
+ //! construct than the value_type and this function offers the possibility to
+ //! use that the part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time.
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the unordered_set.
+ //!
+ //! After a successful rehashing insert_commit_data remains valid.
+ std::pair<iterator, bool> insert_unique_check
+ ( const key_type &key, insert_commit_data &commit_data)
+ { return this->insert_unique_check(key, this->priv_hasher(), this->priv_equal(), commit_data); }
+
//! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
//! must have been obtained from a previous call to "insert_check".
//! No objects should have been inserted or erased from the unordered_set between
diff --git a/boost/intrusive/list.hpp b/boost/intrusive/list.hpp
index cc6d73b..a59734a 100644
--- a/boost/intrusive/list.hpp
+++ b/boost/intrusive/list.hpp
@@ -176,7 +176,20 @@ class list_impl
//!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
- explicit list_impl(const value_traits &v_traits = value_traits())
+ list_impl()
+ : data_(value_traits())
+ {
+ this->priv_size_traits().set_size(size_type(0));
+ node_algorithms::init_header(this->get_root_node());
+ }
+
+ //! <b>Effects</b>: constructs an empty list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
+ explicit list_impl(const value_traits &v_traits)
: data_(v_traits)
{
this->priv_size_traits().set_size(size_type(0));
@@ -1455,7 +1468,11 @@ class list
typedef typename Base::iterator iterator;
typedef typename Base::const_iterator const_iterator;
- explicit list(const value_traits &v_traits = value_traits())
+ list()
+ : Base()
+ {}
+
+ explicit list(const value_traits &v_traits)
: Base(v_traits)
{}
diff --git a/boost/intrusive/member_value_traits.hpp b/boost/intrusive/member_value_traits.hpp
index b540178..01ccf4e 100644
--- a/boost/intrusive/member_value_traits.hpp
+++ b/boost/intrusive/member_value_traits.hpp
@@ -56,19 +56,19 @@ struct member_value_traits
typedef const value_type & const_reference;
static const link_mode_type link_mode = LinkMode;
- static node_ptr to_node_ptr(reference value)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr(reference value)
{ return pointer_traits<node_ptr>::pointer_to(value.*PtrToMember); }
- static const_node_ptr to_node_ptr(const_reference value)
+ BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr(const_reference value)
{ return pointer_traits<const_node_ptr>::pointer_to(value.*PtrToMember); }
- static pointer to_value_ptr(const node_ptr &n)
+ 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));
}
- static const_pointer to_value_ptr(const const_node_ptr &n)
+ 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));
diff --git a/boost/intrusive/parent_from_member.hpp b/boost/intrusive/parent_from_member.hpp
index af3aa1f..a9a9293 100644
--- a/boost/intrusive/parent_from_member.hpp
+++ b/boost/intrusive/parent_from_member.hpp
@@ -13,6 +13,7 @@
#define BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/parent_from_member.hpp>
@@ -29,7 +30,7 @@ namespace intrusive {
//! Note: this function does not work with pointer to members that rely on
//! virtual inheritance.
template<class Parent, class Member>
-inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member)
+BOOST_INTRUSIVE_FORCEINLINE Parent *get_parent_from_member(Member *member, const Member Parent::* ptr_to_member)
{ return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); }
//! Given a const pointer to a member and its corresponding const pointer to data member,
@@ -37,7 +38,7 @@ inline Parent *get_parent_from_member(Member *member, const Member Parent::* ptr
//! Note: this function does not work with pointer to members that rely on
//! virtual inheritance.
template<class Parent, class Member>
-inline const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
+BOOST_INTRUSIVE_FORCEINLINE const Parent *get_parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
{ return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); }
} //namespace intrusive {
diff --git a/boost/intrusive/pointer_plus_bits.hpp b/boost/intrusive/pointer_plus_bits.hpp
index 6168ea8..dfde66b 100644
--- a/boost/intrusive/pointer_plus_bits.hpp
+++ b/boost/intrusive/pointer_plus_bits.hpp
@@ -67,19 +67,19 @@ struct pointer_plus_bits<T*, NumBits>
static const uintptr_t Mask = uintptr_t((uintptr_t(1u) << NumBits) - 1);
typedef T* pointer;
- static pointer get_pointer(pointer n)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer get_pointer(pointer n)
{ return pointer(uintptr_t(n) & uintptr_t(~Mask)); }
- static void set_pointer(pointer &n, pointer p)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_pointer(pointer &n, pointer p)
{
BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (uintptr_t(p) & Mask));
n = pointer(uintptr_t(p) | (uintptr_t(n) & Mask));
}
- static std::size_t get_bits(pointer n)
+ BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_bits(pointer n)
{ return std::size_t(uintptr_t(n) & Mask); }
- static void set_bits(pointer &n, std::size_t c)
+ BOOST_INTRUSIVE_FORCEINLINE static void set_bits(pointer &n, std::size_t c)
{
BOOST_INTRUSIVE_INVARIANT_ASSERT(uintptr_t(c) <= Mask);
n = pointer(uintptr_t((get_pointer)(n)) | uintptr_t(c));
diff --git a/boost/intrusive/pointer_traits.hpp b/boost/intrusive/pointer_traits.hpp
index 731432b..5baf5e8 100644
--- a/boost/intrusive/pointer_traits.hpp
+++ b/boost/intrusive/pointer_traits.hpp
@@ -288,25 +288,25 @@ struct pointer_traits<T*>
//! <b>Returns</b>: addressof(r)
//!
- static pointer pointer_to(reference r)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer pointer_to(reference r)
{ return boost::intrusive::detail::addressof(r); }
//! <b>Returns</b>: static_cast<pointer>(uptr)
//!
template<class U>
- static pointer static_cast_from(U *uptr)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer static_cast_from(U *uptr)
{ return static_cast<pointer>(uptr); }
//! <b>Returns</b>: const_cast<pointer>(uptr)
//!
template<class U>
- static pointer const_cast_from(U *uptr)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer const_cast_from(U *uptr)
{ return const_cast<pointer>(uptr); }
//! <b>Returns</b>: dynamic_cast<pointer>(uptr)
//!
template<class U>
- static pointer dynamic_cast_from(U *uptr)
+ BOOST_INTRUSIVE_FORCEINLINE static pointer dynamic_cast_from(U *uptr)
{ return dynamic_cast<pointer>(uptr); }
};
diff --git a/boost/intrusive/priority_compare.hpp b/boost/intrusive/priority_compare.hpp
index 2ff851f..ffade48 100644
--- a/boost/intrusive/priority_compare.hpp
+++ b/boost/intrusive/priority_compare.hpp
@@ -14,6 +14,7 @@
#define BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/minimal_less_equal_header.hpp>
@@ -33,7 +34,7 @@ struct priority_compare
typedef T second_argument_type;
typedef bool result_type;
- bool operator()(const T &val, const T &val2) const
+ BOOST_INTRUSIVE_FORCEINLINE bool operator()(const T &val, const T &val2) const
{
return priority_order(val, val2);
}
@@ -41,10 +42,10 @@ struct priority_compare
/// @cond
-template<class Less, class T>
+template<class PrioComp, class T>
struct get_prio
{
- typedef Less type;
+ typedef PrioComp type;
};
diff --git a/boost/intrusive/rbtree.hpp b/boost/intrusive/rbtree.hpp
index f3afd01..276362d 100644
--- a/boost/intrusive/rbtree.hpp
+++ b/boost/intrusive/rbtree.hpp
@@ -121,9 +121,13 @@ class rbtree_impl
typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ //! @copydoc ::boost::intrusive::bstree::bstree()
+ rbtree_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit rbtree_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit rbtree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -259,6 +263,14 @@ class rbtree_impl
(const_iterator hint, const KeyType &key
,KeyTypeKeyCompare comp, insert_commit_data &commit_data);
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&)
+ std::pair<iterator, bool> insert_unique_check
+ (const key_type &key, insert_commit_data &commit_data);
+
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const key_type &key, insert_commit_data &commit_data);
+
//! @copydoc ::boost::intrusive::bstree::insert_unique_commit
iterator insert_unique_commit(reference value, const insert_commit_data &commit_data);
@@ -509,8 +521,11 @@ 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));
- explicit rbtree( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ rbtree()
+ : Base()
+ {}
+
+ explicit rbtree( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/set.hpp b/boost/intrusive/set.hpp
index f0072ea..36c46c7 100644
--- a/boost/intrusive/set.hpp
+++ b/boost/intrusive/set.hpp
@@ -83,9 +83,13 @@ class set_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::rbtree::rbtree()
+ set_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::rbtree::rbtree(const key_compare &,const value_traits &)
- explicit set_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -196,6 +200,17 @@ class set_impl
iterator insert(const_iterator hint, reference value)
{ return tree_type::insert_unique(hint, value); }
+ //! @copydoc ::boost::intrusive::rbtree::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::rbtree::insert_unique_check(const_iterator,const key_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); }
+
//! @copydoc ::boost::intrusive::rbtree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_check
@@ -476,8 +491,11 @@ 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));
- explicit set( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ set()
+ : Base()
+ {}
+
+ explicit set( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
@@ -573,9 +591,13 @@ class multiset_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::rbtree::rbtree()
+ multiset_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::rbtree::rbtree(const key_compare &,const value_traits &)
- explicit multiset_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -936,8 +958,11 @@ 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( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ multiset()
+ : Base()
+ {}
+
+ explicit multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/sg_set.hpp b/boost/intrusive/sg_set.hpp
index e6d4e37..171bd59 100644
--- a/boost/intrusive/sg_set.hpp
+++ b/boost/intrusive/sg_set.hpp
@@ -81,9 +81,13 @@ class sg_set_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::sgtree::sgtree()
+ sg_set_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::sgtree::sgtree(const key_compare &,const value_traits &)
- explicit sg_set_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit sg_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -194,6 +198,17 @@ class sg_set_impl
iterator insert(const_iterator hint, reference value)
{ return tree_type::insert_unique(hint, value); }
+ //! @copydoc ::boost::intrusive::sgtree::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::sgtree::insert_unique_check(const_iterator,const key_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); }
+
//! @copydoc ::boost::intrusive::sgtree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_check
@@ -319,21 +334,21 @@ class sg_set_impl
#endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)
+ //! @copydoc ::boost::intrusive::sgtree::equal_range(const key_type &)
std::pair<iterator,iterator> equal_range(const key_type &key)
{ return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)
+ //! @copydoc ::boost::intrusive::sgtree::equal_range(const KeyType&,KeyTypeKeyCompare)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp)
{ return this->tree_type::equal_range(key, comp); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)const
+ //! @copydoc ::boost::intrusive::sgtree::equal_range(const key_type &)const
std::pair<const_iterator, const_iterator>
equal_range(const key_type &key) const
{ return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)const
+ //! @copydoc ::boost::intrusive::sgtree::equal_range(const KeyType&,KeyTypeKeyCompare)const
template<class KeyType, class KeyTypeKeyCompare>
std::pair<const_iterator, const_iterator>
equal_range(const KeyType& key, KeyTypeKeyCompare comp) const
@@ -487,8 +502,11 @@ 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));
- explicit sg_set( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ sg_set()
+ : Base()
+ {}
+
+ explicit sg_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
@@ -584,9 +602,13 @@ class sg_multiset_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::sgtree::sgtree()
+ sg_multiset_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::sgtree::sgtree(const key_compare &,const value_traits &)
- explicit sg_multiset_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit sg_multiset_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -960,8 +982,11 @@ 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( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ sg_multiset()
+ : Base()
+ {}
+
+ explicit sg_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/sgtree.hpp b/boost/intrusive/sgtree.hpp
index b4c4cde..6e7af7d 100644
--- a/boost/intrusive/sgtree.hpp
+++ b/boost/intrusive/sgtree.hpp
@@ -281,9 +281,13 @@ class sgtree_impl
typedef BOOST_INTRUSIVE_IMPDEF(typename node_algorithms::insert_commit_data) insert_commit_data;
+ //! @copydoc ::boost::intrusive::bstree::bstree()
+ sgtree_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit sgtree_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit sgtree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -486,7 +490,11 @@ class sgtree_impl
//! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
- std::pair<iterator, bool> insert_unique_check
+ 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, insert_commit_data &commit_data)
{
std::pair<node_ptr, bool> ret =
@@ -507,6 +515,16 @@ class sgtree_impl
return std::pair<iterator, bool>(iterator(ret.first, this->priv_value_traits_ptr()), ret.second);
}
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&)
+ 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(), commit_data); }
+
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
+ 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(), commit_data); }
+
//! @copydoc ::boost::intrusive::bstree::insert_unique_commit
iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
{
@@ -934,8 +952,11 @@ 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));
- explicit sgtree( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ sgtree()
+ : Base()
+ {}
+
+ explicit sgtree(const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/slist.hpp b/boost/intrusive/slist.hpp
index dd3a05f..d64bf49 100644
--- a/boost/intrusive/slist.hpp
+++ b/boost/intrusive/slist.hpp
@@ -307,7 +307,17 @@ class slist_impl
//!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
- explicit slist_impl(const value_traits &v_traits = value_traits())
+ slist_impl()
+ : data_(value_traits())
+ { this->set_default_constructed_state(); }
+
+ //! <b>Effects</b>: constructs an empty list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
+ explicit slist_impl(const value_traits &v_traits)
: data_(v_traits)
{ this->set_default_constructed_state(); }
@@ -2190,7 +2200,11 @@ class slist
typedef typename Base::size_type size_type;
typedef typename Base::node_ptr node_ptr;
- explicit slist(const value_traits &v_traits = value_traits())
+ slist()
+ : Base()
+ {}
+
+ explicit slist(const value_traits &v_traits)
: Base(v_traits)
{}
diff --git a/boost/intrusive/splay_set.hpp b/boost/intrusive/splay_set.hpp
index 3d43215..893b580 100644
--- a/boost/intrusive/splay_set.hpp
+++ b/boost/intrusive/splay_set.hpp
@@ -81,9 +81,13 @@ class splay_set_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::splaytree::splaytree()
+ splay_set_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::splaytree::splaytree(const key_compare &,const value_traits &)
- explicit splay_set_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit splay_set_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -194,6 +198,17 @@ class splay_set_impl
iterator insert(const_iterator hint, reference value)
{ return tree_type::insert_unique(hint, value); }
+ //! @copydoc ::boost::intrusive::rbtree::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::rbtree::insert_unique_check(const_iterator,const key_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); }
+
//! @copydoc ::boost::intrusive::splaytree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_check
@@ -497,8 +512,11 @@ 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));
- explicit splay_set( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ splay_set()
+ : Base()
+ {}
+
+ explicit splay_set( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
@@ -594,9 +612,13 @@ class splay_multiset_impl
static const bool constant_time_size = tree_type::constant_time_size;
public:
+ //! @copydoc ::boost::intrusive::splaytree::splaytree()
+ splay_multiset_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::splaytree::splaytree(const key_compare &,const value_traits &)
- explicit splay_multiset_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit splay_multiset_impl(const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -973,8 +995,11 @@ 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));
- explicit splay_multiset( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ splay_multiset()
+ : Base()
+ {}
+
+ explicit splay_multiset( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/splaytree.hpp b/boost/intrusive/splaytree.hpp
index 27d75df..afc1081 100644
--- a/boost/intrusive/splaytree.hpp
+++ b/boost/intrusive/splaytree.hpp
@@ -111,9 +111,13 @@ class splaytree_impl
typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ //! @copydoc ::boost::intrusive::bstree::bstree()
+ splaytree_impl()
+ : tree_type()
+ {}
+
//! @copydoc ::boost::intrusive::bstree::bstree(const key_compare &,const value_traits &)
- explicit splaytree_impl( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ explicit splaytree_impl( const key_compare &cmp, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits)
{}
@@ -240,6 +244,14 @@ class splaytree_impl
//! @copydoc ::boost::intrusive::bstree::insert_unique(const_iterator,reference)
iterator insert_unique(const_iterator hint, reference value);
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const key_type&,insert_commit_data&)
+ std::pair<iterator, bool> insert_unique_check
+ (const key_type &key, insert_commit_data &commit_data);
+
+ //! @copydoc ::boost::intrusive::bstree::insert_unique_check(const_iterator,const key_type&,insert_commit_data&)
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const key_type &key, insert_commit_data &commit_data);
+
//! @copydoc ::boost::intrusive::bstree::insert_unique_check(const KeyType&,KeyTypeKeyCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator, bool> insert_unique_check
@@ -584,8 +596,11 @@ 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));
- explicit splaytree( const key_compare &cmp = key_compare()
- , const value_traits &v_traits = value_traits())
+ splaytree()
+ : Base()
+ {}
+
+ explicit splaytree( const key_compare &cmp, const value_traits &v_traits = value_traits())
: Base(cmp, v_traits)
{}
diff --git a/boost/intrusive/treap.hpp b/boost/intrusive/treap.hpp
index 52785da..3852719 100644
--- a/boost/intrusive/treap.hpp
+++ b/boost/intrusive/treap.hpp
@@ -80,7 +80,7 @@ class treap_impl
< typename get_prio
< VoidOrPrioComp
, typename bstree_impl
- <ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>::value_type>::type
+ <ValueTraits, VoidOrKeyOfValue, VoidOrKeyComp, SizeType, ConstantTimeSize, BsTreeAlgorithms, HeaderHolder>::key_type>::type
>
/// @endcond
{
@@ -93,7 +93,7 @@ class treap_impl
typedef tree_type implementation_defined;
typedef get_prio
< VoidOrPrioComp
- , typename tree_type::value_type> get_prio_type;
+ , typename tree_type::key_type> get_prio_type;
typedef detail::ebo_functor_holder
<typename get_prio_type::type> prio_base;
@@ -126,14 +126,11 @@ class treap_impl
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> value_node_prio_comp_t;
+ typedef detail::key_nodeptr_comp<priority_compare, value_traits, key_of_value> key_node_prio_comp_t;
template<class KeyPrioComp>
- detail::key_nodeptr_comp<KeyPrioComp, value_traits> key_node_prio_comp(KeyPrioComp keypriocomp) const
- { return detail::key_nodeptr_comp<KeyPrioComp, value_traits>(keypriocomp, &this->get_value_traits()); }
-
- value_node_prio_comp_t value_node_prio_comp() const
- { return this->key_node_prio_comp(this->priv_pcomp()); }
+ 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()); }
/// @cond
private:
@@ -159,7 +156,18 @@ class treap_impl
//! <b>Throws</b>: If value_traits::node_traits::node
//! 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.
- explicit treap_impl( const key_compare &cmp = key_compare()
+ treap_impl()
+ : tree_type(), prio_base(priority_compare())
+ {}
+
+ //! <b>Effects</b>: Constructs an empty container.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! 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.
+ explicit treap_impl( const key_compare &cmp
, const priority_compare &pcmp = priority_compare()
, const value_traits &v_traits = value_traits())
: tree_type(cmp, v_traits), prio_base(pcmp)
@@ -403,7 +411,7 @@ class treap_impl
( this->tree_type::header_ptr()
, to_insert
, this->key_node_comp(this->key_comp())
- , this->value_node_prio_comp())
+ , this->key_node_prio_comp(this->priv_pcomp()))
, this->priv_value_traits_ptr());
this->tree_type::sz_traits().increment();
return ret;
@@ -433,7 +441,7 @@ class treap_impl
, hint.pointed_node()
, to_insert
, this->key_node_comp(this->key_comp())
- , this->value_node_prio_comp())
+ , this->key_node_prio_comp(this->priv_pcomp()))
, this->priv_value_traits_ptr());
this->tree_type::sz_traits().increment();
return ret;
@@ -478,8 +486,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
- (value, this->comp(), this->priv_pcomp(), commit_data);
+ std::pair<iterator, bool> ret = this->insert_unique_check(key_of_value()(value), commit_data);
if(!ret.second)
return ret;
return std::pair<iterator, bool> (this->insert_unique_commit(value, commit_data), true);
@@ -503,8 +510,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, value, this->comp(), this->priv_pcomp(), commit_data);
+ std::pair<iterator, bool> ret = this->insert_unique_check(hint, key_of_value()(value), commit_data);
if(!ret.second)
return ret.first;
return this->insert_unique_commit(value, commit_data);
@@ -538,6 +544,68 @@ class treap_impl
}
}
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the comparison or predicate functions throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "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); }
+
+ //! <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"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the comparison or predicate functions throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "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); }
+
//! <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
@@ -572,7 +640,11 @@ 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>
- std::pair<iterator, bool> insert_unique_check
+ 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)
{
@@ -678,7 +750,11 @@ class treap_impl
BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!safemode_or_autounlink || node_algorithms::unique(to_insert));
iterator ret
( node_algorithms::insert_before
- ( this->tree_type::header_ptr(), pos.pointed_node(), to_insert, this->value_node_prio_comp())
+ ( this->tree_type::header_ptr()
+ , pos.pointed_node()
+ , to_insert
+ , this->key_node_prio_comp(this->priv_pcomp())
+ )
, this->priv_value_traits_ptr());
this->tree_type::sz_traits().increment();
return ret;
@@ -702,7 +778,8 @@ 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->value_node_prio_comp());
+ node_algorithms::push_back
+ (this->tree_type::header_ptr(), to_insert, this->key_node_prio_comp(this->priv_pcomp()));
this->tree_type::sz_traits().increment();
}
@@ -724,7 +801,8 @@ 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->value_node_prio_comp());
+ node_algorithms::push_front
+ (this->tree_type::header_ptr(), to_insert, this->key_node_prio_comp(this->priv_pcomp()));
this->tree_type::sz_traits().increment();
}
@@ -742,7 +820,8 @@ class treap_impl
++ret;
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->value_node_prio_comp());
+ node_algorithms::erase
+ (this->tree_type::header_ptr(), to_erase, this->key_node_prio_comp(this->priv_pcomp()));
this->tree_type::sz_traits().decrement();
if(safemode_or_autounlink)
node_algorithms::init(to_erase);
@@ -922,8 +1001,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;
tree_type::check(detail::treap_node_extra_checker
- <ValueTraits, value_node_prio_comp_t, ExtraChecker>(this->value_node_prio_comp(), extra_checker));
+ <ValueTraits, nodeptr_prio_comp_t, ExtraChecker>
+ (this->key_node_prio_comp(this->priv_pcomp()), extra_checker));
}
//! @copydoc ::boost::intrusive::bstree::check()const
@@ -1147,8 +1228,11 @@ 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()
+ : Base()
+ {}
- explicit treap( const key_compare &cmp = key_compare()
+ explicit treap( const key_compare &cmp
, const priority_compare &pcmp = priority_compare()
, const value_traits &v_traits = value_traits())
: Base(cmp, pcmp, v_traits)
diff --git a/boost/intrusive/treap_set.hpp b/boost/intrusive/treap_set.hpp
index 60cf449..f97b376 100644
--- a/boost/intrusive/treap_set.hpp
+++ b/boost/intrusive/treap_set.hpp
@@ -83,31 +83,19 @@ class treap_set_impl
static const bool constant_time_size = implementation_defined::constant_time_size;
public:
- //! <b>Effects</b>: Constructs an empty treap_set.
- //!
- //! <b>Complexity</b>: Constant.
- //!
- //! <b>Throws</b>: If value_traits::node_traits::node
- //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the key_compare object throws.
- explicit treap_set_impl( const key_compare &cmp = key_compare()
+ //! @copydoc ::boost::intrusive::treap::treap()
+ treap_set_impl()
+ : tree_type()
+ {}
+
+ //! @copydoc ::boost::intrusive::treap::treap(const key_compare &,const priority_compare &,const value_traits &)
+ explicit treap_set_impl( const key_compare &cmp
, const priority_compare &pcmp = priority_compare()
, const value_traits &v_traits = value_traits())
: tree_type(cmp, pcmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
- //! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty treap_set and inserts elements from
- //! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
- //! comp and otherwise N * log N, where N is distance(last, first).
- //!
- //! <b>Throws</b>: If value_traits::node_traits::node
- //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the key_compare object throws.
+ //! @copydoc ::boost::intrusive::treap::treap(bool,Iterator,Iterator,const key_compare &,const priority_compare &,const value_traits &)
template<class Iterator>
treap_set_impl( Iterator b, Iterator e
, const key_compare &cmp = key_compare()
@@ -241,6 +229,15 @@ 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_iterator,const key_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); }
+
//! @copydoc ::boost::intrusive::treap::insert_unique_check(const KeyType&,KeyTypeKeyCompare,KeyValuePrioCompare,insert_commit_data&)
template<class KeyType, class KeyTypeKeyCompare, class KeyValuePrioCompare>
std::pair<iterator, bool> insert_check
@@ -368,21 +365,21 @@ class treap_set_impl
#endif // #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)
+ //! @copydoc ::boost::intrusive::treap::equal_range(const key_type &)
std::pair<iterator,iterator> equal_range(const key_type &key)
{ return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)
+ //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyTypeKeyCompare)
template<class KeyType, class KeyTypeKeyCompare>
std::pair<iterator,iterator> equal_range(const KeyType& key, KeyTypeKeyCompare comp)
{ return this->tree_type::equal_range(key, comp); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const key_type &)const
+ //! @copydoc ::boost::intrusive::treap::equal_range(const key_type &)const
std::pair<const_iterator, const_iterator>
equal_range(const key_type &key) const
{ return this->tree_type::lower_bound_range(key); }
- //! @copydoc ::boost::intrusive::rbtree::equal_range(const KeyType&,KeyTypeKeyCompare)const
+ //! @copydoc ::boost::intrusive::treap::equal_range(const KeyType&,KeyTypeKeyCompare)const
template<class KeyType, class KeyTypeKeyCompare>
std::pair<const_iterator, const_iterator>
equal_range(const KeyType& key, KeyTypeKeyCompare comp) const
@@ -508,7 +505,11 @@ 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));
- explicit treap_set( const key_compare &cmp = key_compare()
+ treap_set()
+ : Base()
+ {}
+
+ 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)
@@ -608,31 +609,20 @@ class treap_multiset_impl
static const bool constant_time_size = implementation_defined::constant_time_size;
public:
- //! <b>Effects</b>: Constructs an empty treap_multiset.
- //!
- //! <b>Complexity</b>: Constant.
- //!
- //! <b>Throws</b>: If value_traits::node_traits::node
- //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor of the key_compare object throws.
- explicit treap_multiset_impl( const key_compare &cmp = key_compare()
+
+ //! @copydoc ::boost::intrusive::treap::treap()
+ treap_multiset_impl()
+ : tree_type()
+ {}
+
+ //! @copydoc ::boost::intrusive::treap::treap(const key_compare &,const priority_compare &,const value_traits &)
+ explicit treap_multiset_impl( const key_compare &cmp
, const priority_compare &pcmp = priority_compare()
, const value_traits &v_traits = value_traits())
: tree_type(cmp, pcmp, v_traits)
{}
- //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
- //! cmp must be a comparison function that induces a strict weak ordering.
- //!
- //! <b>Effects</b>: Constructs an empty treap_multiset and inserts elements from
- //! [b, e).
- //!
- //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
- //! comp and otherwise N * log N, where N is distance(last, first).
- //!
- //! <b>Throws</b>: If value_traits::node_traits::node
- //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
- //! or the copy constructor/operator() of the key_compare object throws.
+ //! @copydoc ::boost::intrusive::treap::treap(bool,Iterator,Iterator,const key_compare &,const priority_compare &,const value_traits &)
template<class Iterator>
treap_multiset_impl( Iterator b, Iterator e
, const key_compare &cmp = key_compare()
@@ -1000,7 +990,11 @@ 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));
- explicit treap_multiset( const key_compare &cmp = key_compare()
+ treap_multiset()
+ : Base()
+ {}
+
+ 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)
diff --git a/boost/intrusive/trivial_value_traits.hpp b/boost/intrusive/trivial_value_traits.hpp
index 03deb16..84fac66 100644
--- a/boost/intrusive/trivial_value_traits.hpp
+++ b/boost/intrusive/trivial_value_traits.hpp
@@ -14,6 +14,7 @@
#define BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/pointer_traits.hpp>
@@ -42,12 +43,12 @@ struct trivial_value_traits
typedef node_ptr pointer;
typedef const_node_ptr const_pointer;
static const link_mode_type link_mode = LinkMode;
- static node_ptr to_node_ptr (value_type &value)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr (value_type &value)
{ return pointer_traits<node_ptr>::pointer_to(value); }
- static const_node_ptr to_node_ptr (const value_type &value)
+ BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr (const value_type &value)
{ return pointer_traits<const_node_ptr>::pointer_to(value); }
- static const pointer & to_value_ptr(const node_ptr &n) { return n; }
- static const const_pointer &to_value_ptr(const const_node_ptr &n) { return n; }
+ BOOST_INTRUSIVE_FORCEINLINE static const pointer & to_value_ptr(const node_ptr &n) { return n; }
+ BOOST_INTRUSIVE_FORCEINLINE static const const_pointer &to_value_ptr(const const_node_ptr &n) { return n; }
};
} //namespace intrusive
diff --git a/boost/intrusive/unordered_set.hpp b/boost/intrusive/unordered_set.hpp
index 5148f02..1174dff 100644
--- a/boost/intrusive/unordered_set.hpp
+++ b/boost/intrusive/unordered_set.hpp
@@ -208,6 +208,10 @@ class unordered_set_impl
void insert(Iterator b, Iterator e)
{ table_type::insert_unique(b, e); }
+ //! @copydoc ::boost::intrusive::hashtable::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 table_type::insert_unique_check(key, commit_data); }
+
//! @copydoc ::boost::intrusive::hashtable::insert_unique_check(const KeyType&,KeyHasher,KeyEqual,insert_commit_data&)
template<class KeyType, class KeyHasher, class KeyEqual>
std::pair<iterator, bool> insert_check