summaryrefslogtreecommitdiff
path: root/boost/intrusive
diff options
context:
space:
mode:
Diffstat (limited to 'boost/intrusive')
-rw-r--r--boost/intrusive/detail/hashtable_node.hpp27
-rw-r--r--boost/intrusive/detail/workaround.hpp3
-rw-r--r--boost/intrusive/member_value_traits.hpp1
-rw-r--r--boost/intrusive/unordered_set.hpp56
4 files changed, 45 insertions, 42 deletions
diff --git a/boost/intrusive/detail/hashtable_node.hpp b/boost/intrusive/detail/hashtable_node.hpp
index 0471ebe684..8f8718e9a7 100644
--- a/boost/intrusive/detail/hashtable_node.hpp
+++ b/boost/intrusive/detail/hashtable_node.hpp
@@ -40,23 +40,22 @@ template <class Slist>
struct bucket_impl : public Slist
{
typedef Slist slist_type;
- bucket_impl()
+ BOOST_INTRUSIVE_FORCEINLINE bucket_impl()
{}
- bucket_impl(const bucket_impl &)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_impl(const bucket_impl &)
{}
- ~bucket_impl()
+ BOOST_INTRUSIVE_FORCEINLINE ~bucket_impl()
{
//This bucket is still being used!
BOOST_INTRUSIVE_INVARIANT_ASSERT(Slist::empty());
}
- bucket_impl &operator=(const bucket_impl&)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_impl &operator=(const bucket_impl&)
{
//This bucket is still in use!
BOOST_INTRUSIVE_INVARIANT_ASSERT(Slist::empty());
- //Slist::clear();
return *this;
}
};
@@ -77,25 +76,25 @@ struct bucket_traits_impl
typedef typename Slist::size_type size_type;
/// @endcond
- bucket_traits_impl(bucket_ptr buckets, size_type len)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl(bucket_ptr buckets, size_type len)
: buckets_(buckets), buckets_len_(len)
{}
- bucket_traits_impl(const bucket_traits_impl &x)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl(const bucket_traits_impl &x)
: buckets_(x.buckets_), buckets_len_(x.buckets_len_)
{}
- bucket_traits_impl(BOOST_RV_REF(bucket_traits_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl(BOOST_RV_REF(bucket_traits_impl) x)
: buckets_(x.buckets_), buckets_len_(x.buckets_len_)
{ x.buckets_ = bucket_ptr(); x.buckets_len_ = 0; }
- bucket_traits_impl& operator=(BOOST_RV_REF(bucket_traits_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl& operator=(BOOST_RV_REF(bucket_traits_impl) x)
{
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_;
x.buckets_ = bucket_ptr(); x.buckets_len_ = 0; return *this;
}
- bucket_traits_impl& operator=(BOOST_COPY_ASSIGN_REF(bucket_traits_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE bucket_traits_impl& operator=(BOOST_COPY_ASSIGN_REF(bucket_traits_impl) x)
{
buckets_ = x.buckets_; buckets_len_ = x.buckets_len_; return *this;
}
@@ -182,7 +181,7 @@ class hashtable_iterator
< const BucketValueTraits >::type const_bucketvaltraits_ptr;
typedef typename slist_impl::size_type size_type;
- static node_ptr downcast_bucket(typename bucket_type::node_ptr p)
+ BOOST_INTRUSIVE_FORCEINLINE static node_ptr downcast_bucket(typename bucket_type::node_ptr p)
{
return pointer_traits<node_ptr>::
pointer_to(static_cast<typename node_traits::node&>(*p));
@@ -199,17 +198,17 @@ class hashtable_iterator
, traitsptr_ (cont ? pointer_traits<const_bucketvaltraits_ptr>::pointer_to(*cont) : const_bucketvaltraits_ptr() )
{}
- hashtable_iterator(const hashtable_iterator<BucketValueTraits, false> &other)
+ BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator(const hashtable_iterator<BucketValueTraits, false> &other)
: slist_it_(other.slist_it()), traitsptr_(other.get_bucket_value_traits())
{}
BOOST_INTRUSIVE_FORCEINLINE const siterator &slist_it() const
{ return slist_it_; }
- hashtable_iterator<BucketValueTraits, false> unconst() const
+ BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator<BucketValueTraits, false> unconst() const
{ return hashtable_iterator<BucketValueTraits, false>(this->slist_it(), this->get_bucket_value_traits()); }
- hashtable_iterator& operator++()
+ BOOST_INTRUSIVE_FORCEINLINE hashtable_iterator& operator++()
{ this->increment(); return *this; }
hashtable_iterator operator++(int)
diff --git a/boost/intrusive/detail/workaround.hpp b/boost/intrusive/detail/workaround.hpp
index 7a9ac48e0b..594ac0b2e5 100644
--- a/boost/intrusive/detail/workaround.hpp
+++ b/boost/intrusive/detail/workaround.hpp
@@ -43,6 +43,9 @@
#elif defined(BOOST_MSVC) && defined(_DEBUG)
//"__forceinline" and MSVC seems to have some bugs in debug mode
#define BOOST_INTRUSIVE_FORCEINLINE inline
+#elif defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ < 5)))
+ //Older GCCs have problems with forceinline
+ #define BOOST_INTRUSIVE_FORCEINLINE inline
#else
#define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
#endif
diff --git a/boost/intrusive/member_value_traits.hpp b/boost/intrusive/member_value_traits.hpp
index 01ccf4e38f..4efe79ebdb 100644
--- a/boost/intrusive/member_value_traits.hpp
+++ b/boost/intrusive/member_value_traits.hpp
@@ -18,6 +18,7 @@
#include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/detail/parent_from_member.hpp>
+#include <boost/intrusive/detail/to_raw_pointer.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#if defined(BOOST_HAS_PRAGMA_ONCE)
diff --git a/boost/intrusive/unordered_set.hpp b/boost/intrusive/unordered_set.hpp
index 1968fa250e..cf60dc4f7a 100644
--- a/boost/intrusive/unordered_set.hpp
+++ b/boost/intrusive/unordered_set.hpp
@@ -120,7 +120,7 @@ class unordered_set_impl
public:
//! @copydoc ::boost::intrusive::hashtable::hashtable(const bucket_traits &,const hasher &,const key_equal &,const value_traits &)
- explicit unordered_set_impl( const bucket_traits &b_traits
+ BOOST_INTRUSIVE_FORCEINLINE explicit unordered_set_impl( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
, const value_traits &v_traits = value_traits())
@@ -129,7 +129,7 @@ class unordered_set_impl
//! @copydoc ::boost::intrusive::hashtable::hashtable(bool,Iterator,Iterator,const bucket_traits &,const hasher &,const key_equal &,const value_traits &)
template<class Iterator>
- unordered_set_impl( Iterator b
+ BOOST_INTRUSIVE_FORCEINLINE unordered_set_impl( Iterator b
, Iterator e
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
@@ -139,12 +139,12 @@ class unordered_set_impl
{}
//! @copydoc ::boost::intrusive::hashtable::hashtable(hashtable&&)
- unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_set_impl(BOOST_RV_REF(unordered_set_impl) x)
: table_type(BOOST_MOVE_BASE(table_type, x))
{}
//! @copydoc ::boost::intrusive::hashtable::operator=(hashtable&&)
- unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_set_impl& operator=(BOOST_RV_REF(unordered_set_impl) x)
{ return static_cast<unordered_set_impl&>(table_type::operator=(BOOST_MOVE_BASE(table_type, x))); }
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
@@ -196,30 +196,30 @@ class unordered_set_impl
//! @copydoc ::boost::intrusive::hashtable::clone_from(hashtable&&,Cloner,Disposer)
template <class Cloner, class Disposer>
- void clone_from(BOOST_RV_REF(unordered_set_impl) src, Cloner cloner, Disposer disposer)
+ BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(unordered_set_impl) src, Cloner cloner, Disposer disposer)
{ table_type::clone_from(BOOST_MOVE_BASE(table_type, src), cloner, disposer); }
//! @copydoc ::boost::intrusive::hashtable::insert_unique(reference)
- std::pair<iterator, bool> insert(reference value)
+ BOOST_INTRUSIVE_FORCEINLINE std::pair<iterator, bool> insert(reference value)
{ return table_type::insert_unique(value); }
//! @copydoc ::boost::intrusive::hashtable::insert_unique(Iterator,Iterator)
template<class Iterator>
- void insert(Iterator b, Iterator e)
+ BOOST_INTRUSIVE_FORCEINLINE 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)
+ BOOST_INTRUSIVE_FORCEINLINE 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
+ BOOST_INTRUSIVE_FORCEINLINE std::pair<iterator, bool> insert_check
(const KeyType &key, KeyHasher hasher, KeyEqual key_value_equal, insert_commit_data &commit_data)
{ return table_type::insert_unique_check(key, hasher, key_value_equal, commit_data); }
//! @copydoc ::boost::intrusive::hashtable::insert_unique_commit
- iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ BOOST_INTRUSIVE_FORCEINLINE iterator insert_commit(reference value, const insert_commit_data &commit_data)
{ return table_type::insert_unique_commit(value, commit_data); }
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
@@ -506,8 +506,8 @@ class unordered_set
{}
template<class Iterator>
- unordered_set ( Iterator b
- , Iterator e
+ BOOST_INTRUSIVE_FORCEINLINE unordered_set
+ ( Iterator b, Iterator e
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
@@ -515,19 +515,19 @@ class unordered_set
: Base(b, e, b_traits, hash_func, equal_func, v_traits)
{}
- unordered_set(BOOST_RV_REF(unordered_set) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_set(BOOST_RV_REF(unordered_set) x)
: Base(BOOST_MOVE_BASE(Base, x))
{}
- unordered_set& operator=(BOOST_RV_REF(unordered_set) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_set& operator=(BOOST_RV_REF(unordered_set) x)
{ return static_cast<unordered_set&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
template <class Cloner, class Disposer>
- void clone_from(const unordered_set &src, Cloner cloner, Disposer disposer)
+ BOOST_INTRUSIVE_FORCEINLINE void clone_from(const unordered_set &src, Cloner cloner, Disposer disposer)
{ Base::clone_from(src, cloner, disposer); }
template <class Cloner, class Disposer>
- void clone_from(BOOST_RV_REF(unordered_set) src, Cloner cloner, Disposer disposer)
+ BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(unordered_set) src, Cloner cloner, Disposer disposer)
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
};
@@ -616,7 +616,7 @@ class unordered_multiset_impl
public:
//! @copydoc ::boost::intrusive::hashtable::hashtable(const bucket_traits &,const hasher &,const key_equal &,const value_traits &)
- explicit unordered_multiset_impl ( const bucket_traits &b_traits
+ BOOST_INTRUSIVE_FORCEINLINE explicit unordered_multiset_impl ( const bucket_traits &b_traits
, const hasher & hash_func = hasher()
, const key_equal &equal_func = key_equal()
, const value_traits &v_traits = value_traits())
@@ -625,7 +625,7 @@ class unordered_multiset_impl
//! @copydoc ::boost::intrusive::hashtable::hashtable(bool,Iterator,Iterator,const bucket_traits &,const hasher &,const key_equal &,const value_traits &)
template<class Iterator>
- unordered_multiset_impl ( Iterator b
+ BOOST_INTRUSIVE_FORCEINLINE unordered_multiset_impl ( Iterator b
, Iterator e
, const bucket_traits &b_traits
, const hasher & hash_func = hasher()
@@ -636,13 +636,13 @@ class unordered_multiset_impl
//! <b>Effects</b>: to-do
//!
- unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_multiset_impl(BOOST_RV_REF(unordered_multiset_impl) x)
: table_type(BOOST_MOVE_BASE(table_type, x))
{}
//! <b>Effects</b>: to-do
//!
- unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_multiset_impl& operator=(BOOST_RV_REF(unordered_multiset_impl) x)
{ return static_cast<unordered_multiset_impl&>(table_type::operator=(BOOST_MOVE_BASE(table_type, x))); }
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
@@ -695,16 +695,16 @@ class unordered_multiset_impl
//! @copydoc ::boost::intrusive::hashtable::clone_from(hashtable&&,Cloner,Disposer)
template <class Cloner, class Disposer>
- void clone_from(BOOST_RV_REF(unordered_multiset_impl) src, Cloner cloner, Disposer disposer)
+ BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(unordered_multiset_impl) src, Cloner cloner, Disposer disposer)
{ table_type::clone_from(BOOST_MOVE_BASE(table_type, src), cloner, disposer); }
//! @copydoc ::boost::intrusive::hashtable::insert_equal(reference)
- iterator insert(reference value)
+ BOOST_INTRUSIVE_FORCEINLINE iterator insert(reference value)
{ return table_type::insert_equal(value); }
//! @copydoc ::boost::intrusive::hashtable::insert_equal(Iterator,Iterator)
template<class Iterator>
- void insert(Iterator b, Iterator e)
+ BOOST_INTRUSIVE_FORCEINLINE void insert(Iterator b, Iterator e)
{ table_type::insert_equal(b, e); }
#ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
@@ -954,7 +954,7 @@ class unordered_multiset
: Base(b_traits, hash_func, equal_func, v_traits)
{}
- template<class Iterator>
+ template<class Iterator> BOOST_INTRUSIVE_FORCEINLINE
unordered_multiset( Iterator b
, Iterator e
, const bucket_traits &b_traits
@@ -964,19 +964,19 @@ class unordered_multiset
: Base(b, e, b_traits, hash_func, equal_func, v_traits)
{}
- unordered_multiset(BOOST_RV_REF(unordered_multiset) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_multiset(BOOST_RV_REF(unordered_multiset) x)
: Base(BOOST_MOVE_BASE(Base, x))
{}
- unordered_multiset& operator=(BOOST_RV_REF(unordered_multiset) x)
+ BOOST_INTRUSIVE_FORCEINLINE unordered_multiset& operator=(BOOST_RV_REF(unordered_multiset) x)
{ return static_cast<unordered_multiset&>(this->Base::operator=(BOOST_MOVE_BASE(Base, x))); }
template <class Cloner, class Disposer>
- void clone_from(const unordered_multiset &src, Cloner cloner, Disposer disposer)
+ BOOST_INTRUSIVE_FORCEINLINE void clone_from(const unordered_multiset &src, Cloner cloner, Disposer disposer)
{ Base::clone_from(src, cloner, disposer); }
template <class Cloner, class Disposer>
- void clone_from(BOOST_RV_REF(unordered_multiset) src, Cloner cloner, Disposer disposer)
+ BOOST_INTRUSIVE_FORCEINLINE void clone_from(BOOST_RV_REF(unordered_multiset) src, Cloner cloner, Disposer disposer)
{ Base::clone_from(BOOST_MOVE_BASE(Base, src), cloner, disposer); }
};