mirror of
https://github.com/boostorg/intrusive.git
synced 2025-08-03 14:34:44 +02:00
More changes for Boost 1.45
[SVN r64985]
This commit is contained in:
@@ -63,7 +63,7 @@ class circular_slist_algorithms
|
|||||||
|
|
||||||
//! <b>Effects</b>: Constructs an non-used list element, putting the next
|
//! <b>Effects</b>: Constructs an non-used list element, putting the next
|
||||||
//! pointer to null:
|
//! pointer to null:
|
||||||
//! <tt>NodeTraits::get_next(this_node) == 0
|
//! <tt>NodeTraits::get_next(this_node) == 0</tt>
|
||||||
//!
|
//!
|
||||||
//! <b>Complexity</b>: Constant
|
//! <b>Complexity</b>: Constant
|
||||||
//!
|
//!
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#define BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
|
#define BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
|
||||||
|
|
||||||
#include <boost/intrusive/link_mode.hpp>
|
#include <boost/intrusive/link_mode.hpp>
|
||||||
|
#include <boost/pointer_cast.hpp>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
@@ -44,10 +45,20 @@ struct derivation_value_traits
|
|||||||
{ return node_ptr(&value); }
|
{ return node_ptr(&value); }
|
||||||
|
|
||||||
static pointer to_value_ptr(node_ptr n)
|
static pointer to_value_ptr(node_ptr n)
|
||||||
{ return pointer(static_cast<T*>(detail::boost_intrusive_get_pointer(n))); }
|
{
|
||||||
|
// This still fails in gcc < 4.4 so forget about it
|
||||||
|
// using ::boost::static_pointer_cast;
|
||||||
|
// return static_pointer_cast<value_type>(n));
|
||||||
|
return pointer(&static_cast<value_type&>(*n));
|
||||||
|
}
|
||||||
|
|
||||||
static const_pointer to_value_ptr(const_node_ptr n)
|
static const_pointer to_value_ptr(const_node_ptr n)
|
||||||
{ return const_pointer(static_cast<const T*>(detail::boost_intrusive_get_pointer(n))); }
|
{
|
||||||
|
// This still fails in gcc < 4.4 so forget about it
|
||||||
|
// using ::boost::static_pointer_cast;
|
||||||
|
// return static_pointer_cast<const value_type>(n));
|
||||||
|
return const_pointer(&static_cast<const value_type&>(*n));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace intrusive
|
} //namespace intrusive
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <boost/intrusive/detail/mpl.hpp>
|
#include <boost/intrusive/detail/mpl.hpp>
|
||||||
|
#include <boost/pointer_cast.hpp>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace intrusive {
|
namespace intrusive {
|
||||||
@@ -87,7 +88,10 @@ struct any_unordered_node_traits
|
|||||||
static const bool optimize_multikey = true;
|
static const bool optimize_multikey = true;
|
||||||
|
|
||||||
static node_ptr get_next(const_node_ptr n)
|
static node_ptr get_next(const_node_ptr n)
|
||||||
{ return node_ptr(&static_cast<node &>(*n->node_ptr_1)); }
|
{
|
||||||
|
using ::boost::static_pointer_cast;
|
||||||
|
return static_pointer_cast<node>(n->node_ptr_1);
|
||||||
|
}
|
||||||
|
|
||||||
static void set_next(node_ptr n, node_ptr next)
|
static void set_next(node_ptr n, node_ptr next)
|
||||||
{ n->node_ptr_1 = next; }
|
{ n->node_ptr_1 = next; }
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#include <boost/intrusive/detail/utilities.hpp>
|
#include <boost/intrusive/detail/utilities.hpp>
|
||||||
#include <boost/intrusive/detail/slist_node.hpp> //remove-me
|
#include <boost/intrusive/detail/slist_node.hpp> //remove-me
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <boost/pointer_cast.hpp>
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace intrusive {
|
namespace intrusive {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
@@ -118,7 +118,12 @@ class hashtable_iterator
|
|||||||
typedef typename Container::size_type size_type;
|
typedef typename Container::size_type size_type;
|
||||||
|
|
||||||
static typename Container::node_ptr downcast_bucket(typename bucket_type::node_ptr p)
|
static typename Container::node_ptr downcast_bucket(typename bucket_type::node_ptr p)
|
||||||
{ return typename Container::node_ptr(&static_cast<typename Container::node&>(*p)); }
|
{
|
||||||
|
// This still fails in gcc < 4.4 so forget about it
|
||||||
|
// using ::boost::static_pointer_cast;
|
||||||
|
// return static_pointer_cast<typename Container::node>(p);
|
||||||
|
return typename Container::node_ptr(&static_cast<typename Container::node&>(*p));
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename Container::value_type value_type;
|
typedef typename Container::value_type value_type;
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
// See http://www.boost.org/libs/intrusive for documentation.
|
// See http://www.boost.org/libs/intrusive for documentation.
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
#ifndef BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
|
#ifndef BOOST_INTRUSIVE_DETAIL_PARENT_FROM_MEMBER_HPP
|
||||||
#define BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
|
#define BOOST_INTRUSIVE_DETAIL_PARENT_FROM_MEMBER_HPP
|
||||||
|
|
||||||
#include <boost/intrusive/detail/config_begin.hpp>
|
#include <boost/intrusive/detail/config_begin.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@@ -47,15 +47,13 @@ inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_t
|
|||||||
template<class Parent, class Member>
|
template<class Parent, class Member>
|
||||||
inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member)
|
inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member)
|
||||||
{
|
{
|
||||||
return (Parent*)((char*)member -
|
return (Parent*)((char*)member - offset_from_pointer_to_member(ptr_to_member));
|
||||||
offset_from_pointer_to_member(ptr_to_member));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Parent, class Member>
|
template<class Parent, class Member>
|
||||||
inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
|
inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
|
||||||
{
|
{
|
||||||
return (const Parent*)((const char*)member -
|
return (const Parent*)((const char*)member - offset_from_pointer_to_member(ptr_to_member));
|
||||||
offset_from_pointer_to_member(ptr_to_member));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace detail {
|
} //namespace detail {
|
||||||
@@ -68,4 +66,4 @@ inline const Parent *parent_from_member(const Member *member, const Member Paren
|
|||||||
|
|
||||||
#include <boost/intrusive/detail/config_end.hpp>
|
#include <boost/intrusive/detail/config_end.hpp>
|
||||||
|
|
||||||
#endif //#ifndef BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
|
#endif //#ifndef BOOST_INTRUSIVE_DETAIL_PARENT_FROM_MEMBER_HPP
|
||||||
|
@@ -410,14 +410,10 @@ struct member_hook_traits
|
|||||||
static const link_mode_type link_mode = Hook::boost_intrusive_tags::link_mode;
|
static const link_mode_type link_mode = Hook::boost_intrusive_tags::link_mode;
|
||||||
|
|
||||||
static node_ptr to_node_ptr(reference value)
|
static node_ptr to_node_ptr(reference value)
|
||||||
{
|
{ return static_cast<node*>(&(value.*P)); }
|
||||||
return reinterpret_cast<node*>(&(value.*P));
|
|
||||||
}
|
|
||||||
|
|
||||||
static const_node_ptr to_node_ptr(const_reference value)
|
static const_node_ptr to_node_ptr(const_reference value)
|
||||||
{
|
{ return static_cast<const node*>(&(value.*P)); }
|
||||||
return static_cast<const node*>(&(value.*P));
|
|
||||||
}
|
|
||||||
|
|
||||||
static pointer to_value_ptr(node_ptr n)
|
static pointer to_value_ptr(node_ptr n)
|
||||||
{
|
{
|
||||||
@@ -432,6 +428,45 @@ struct member_hook_traits
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<class Functor>
|
||||||
|
struct function_hook_traits
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef typename Functor::hook_type hook_type;
|
||||||
|
typedef typename Functor::hook_ptr hook_ptr;
|
||||||
|
typedef typename Functor::const_hook_ptr const_hook_ptr;
|
||||||
|
typedef typename hook_type::boost_intrusive_tags::node_traits node_traits;
|
||||||
|
typedef typename node_traits::node node;
|
||||||
|
typedef typename Functor::value_type value_type;
|
||||||
|
typedef typename node_traits::node_ptr node_ptr;
|
||||||
|
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||||
|
typedef typename boost::pointer_to_other<node_ptr, value_type>::type pointer;
|
||||||
|
typedef typename boost::pointer_to_other<node_ptr, const value_type>::type const_pointer;
|
||||||
|
typedef typename std::iterator_traits<pointer>::reference reference;
|
||||||
|
typedef typename std::iterator_traits<const_pointer>::reference const_reference;
|
||||||
|
static const link_mode_type link_mode = hook_type::boost_intrusive_tags::link_mode;
|
||||||
|
|
||||||
|
static node_ptr to_node_ptr(reference value)
|
||||||
|
{ return static_cast<node*>(&*Functor::to_hook_ptr(value)); }
|
||||||
|
|
||||||
|
static const_node_ptr to_node_ptr(const_reference value)
|
||||||
|
{ return static_cast<const node*>(&*Functor::to_hook_ptr(value)); }
|
||||||
|
|
||||||
|
static pointer to_value_ptr(node_ptr n)
|
||||||
|
{ return Functor::to_value_ptr(to_hook_ptr(n)); }
|
||||||
|
|
||||||
|
static const_pointer to_value_ptr(const_node_ptr n)
|
||||||
|
{ return Functor::to_value_ptr(to_hook_ptr(n)); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
static hook_ptr to_hook_ptr(node_ptr n)
|
||||||
|
{ return hook_ptr(&*static_cast<hook_type*>(&*n)); }
|
||||||
|
|
||||||
|
static const_hook_ptr to_hook_ptr(const_node_ptr n)
|
||||||
|
{ return const_hook_ptr(&*static_cast<const hook_type*>(&*n)); }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//This function uses binary search to discover the
|
//This function uses binary search to discover the
|
||||||
//highest set bit of the integer
|
//highest set bit of the integer
|
||||||
inline std::size_t floor_log2 (std::size_t x)
|
inline std::size_t floor_log2 (std::size_t x)
|
||||||
@@ -454,14 +489,19 @@ inline std::size_t floor_log2 (std::size_t x)
|
|||||||
|
|
||||||
inline float fast_log2 (float val)
|
inline float fast_log2 (float val)
|
||||||
{
|
{
|
||||||
boost::uint32_t * exp_ptr =
|
union caster_t
|
||||||
static_cast<boost::uint32_t *>(static_cast<void*>(&val));
|
{
|
||||||
boost::uint32_t x = *exp_ptr;
|
boost::uint32_t x;
|
||||||
|
float val;
|
||||||
|
} caster;
|
||||||
|
|
||||||
|
caster.val = val;
|
||||||
|
boost::uint32_t x = caster.x;
|
||||||
const int log_2 = (int)(((x >> 23) & 255) - 128);
|
const int log_2 = (int)(((x >> 23) & 255) - 128);
|
||||||
x &= ~(255 << 23);
|
x &= ~(255 << 23);
|
||||||
x += 127 << 23;
|
x += 127 << 23;
|
||||||
*exp_ptr = x;
|
caster.x = x;
|
||||||
|
val = caster.val;
|
||||||
val = ((-1.0f/3) * val + 2) * val - 2.0f/3;
|
val = ((-1.0f/3) * val + 2) * val - 2.0f/3;
|
||||||
|
|
||||||
return (val + log_2);
|
return (val + log_2);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <boost/intrusive/detail/assert.hpp>
|
#include <boost/intrusive/detail/assert.hpp>
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
|
#include <boost/pointer_cast.hpp>
|
||||||
//General intrusive utilities
|
//General intrusive utilities
|
||||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||||
@@ -157,26 +158,22 @@ struct get_slist_impl_from_supposed_value_traits
|
|||||||
template<class SupposedValueTraits>
|
template<class SupposedValueTraits>
|
||||||
struct unordered_bucket_impl
|
struct unordered_bucket_impl
|
||||||
{
|
{
|
||||||
/// @cond
|
|
||||||
typedef typename
|
typedef typename
|
||||||
get_slist_impl_from_supposed_value_traits
|
get_slist_impl_from_supposed_value_traits
|
||||||
<SupposedValueTraits>::type slist_impl;
|
<SupposedValueTraits>::type slist_impl;
|
||||||
typedef detail::bucket_impl<slist_impl> implementation_defined;
|
typedef detail::bucket_impl<slist_impl> implementation_defined;
|
||||||
/// @endcond
|
|
||||||
typedef implementation_defined type;
|
typedef implementation_defined type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class SupposedValueTraits>
|
template<class SupposedValueTraits>
|
||||||
struct unordered_bucket_ptr_impl
|
struct unordered_bucket_ptr_impl
|
||||||
{
|
{
|
||||||
/// @cond
|
|
||||||
typedef typename detail::get_node_traits
|
typedef typename detail::get_node_traits
|
||||||
<SupposedValueTraits>::type::node_ptr node_ptr;
|
<SupposedValueTraits>::type::node_ptr node_ptr;
|
||||||
typedef typename unordered_bucket_impl
|
typedef typename unordered_bucket_impl
|
||||||
<SupposedValueTraits>::type bucket_type;
|
<SupposedValueTraits>::type bucket_type;
|
||||||
typedef typename boost::pointer_to_other
|
typedef typename boost::pointer_to_other
|
||||||
<node_ptr, bucket_type>::type implementation_defined;
|
<node_ptr, bucket_type>::type implementation_defined;
|
||||||
/// @endcond
|
|
||||||
typedef implementation_defined type;
|
typedef implementation_defined type;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -329,7 +326,12 @@ struct group_functions
|
|||||||
typedef circular_slist_algorithms<group_traits> group_algorithms;
|
typedef circular_slist_algorithms<group_traits> group_algorithms;
|
||||||
|
|
||||||
static node_ptr dcast_bucket_ptr(slist_node_ptr p)
|
static node_ptr dcast_bucket_ptr(slist_node_ptr p)
|
||||||
{ return node_ptr(&static_cast<node&>(*p)); }
|
{
|
||||||
|
// This still fails in gcc < 4.4 so forget about it
|
||||||
|
// using ::boost::static_pointer_cast;
|
||||||
|
// return static_pointer_cast<node>(p);
|
||||||
|
return node_ptr(&static_cast<node&>(*p));
|
||||||
|
}
|
||||||
|
|
||||||
static slist_node_ptr priv_get_bucket_before_begin
|
static slist_node_ptr priv_get_bucket_before_begin
|
||||||
(slist_node_ptr bucket_beg, slist_node_ptr bucket_end, node_ptr p)
|
(slist_node_ptr bucket_beg, slist_node_ptr bucket_end, node_ptr p)
|
||||||
@@ -496,7 +498,6 @@ struct unordered_bucket_ptr
|
|||||||
template<class ValueTraitsOrHookOption>
|
template<class ValueTraitsOrHookOption>
|
||||||
struct unordered_default_bucket_traits
|
struct unordered_default_bucket_traits
|
||||||
{
|
{
|
||||||
/// @cond
|
|
||||||
typedef typename ValueTraitsOrHookOption::
|
typedef typename ValueTraitsOrHookOption::
|
||||||
template pack<none>::value_traits supposed_value_traits;
|
template pack<none>::value_traits supposed_value_traits;
|
||||||
typedef typename detail::
|
typedef typename detail::
|
||||||
@@ -504,7 +505,6 @@ struct unordered_default_bucket_traits
|
|||||||
<supposed_value_traits>::type slist_impl;
|
<supposed_value_traits>::type slist_impl;
|
||||||
typedef detail::bucket_traits_impl
|
typedef detail::bucket_traits_impl
|
||||||
<slist_impl> implementation_defined;
|
<slist_impl> implementation_defined;
|
||||||
/// @endcond
|
|
||||||
typedef implementation_defined type;
|
typedef implementation_defined type;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2322,7 +2322,12 @@ class hashtable_impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
static node_ptr dcast_bucket_ptr(typename slist_impl::node_ptr p)
|
static node_ptr dcast_bucket_ptr(typename slist_impl::node_ptr p)
|
||||||
{ return node_ptr(&static_cast<node&>(*p)); }
|
{
|
||||||
|
// This still fails in gcc < 4.4 so forget about it
|
||||||
|
// using ::boost::static_pointer_cast;
|
||||||
|
// return static_pointer_cast<node>(p);
|
||||||
|
return node_ptr(&static_cast<node&>(*p));
|
||||||
|
}
|
||||||
|
|
||||||
std::size_t priv_stored_or_compute_hash(const value_type &v, detail::true_) const
|
std::size_t priv_stored_or_compute_hash(const value_type &v, detail::true_) const
|
||||||
{ return node_traits::get_hash(this->get_real_value_traits().to_node_ptr(v)); }
|
{ return node_traits::get_hash(this->get_real_value_traits().to_node_ptr(v)); }
|
||||||
@@ -2889,7 +2894,6 @@ struct make_hashtable_opt
|
|||||||
//Real value traits must be calculated from options
|
//Real value traits must be calculated from options
|
||||||
typedef typename detail::get_value_traits
|
typedef typename detail::get_value_traits
|
||||||
<T, typename packed_options::value_traits>::type value_traits;
|
<T, typename packed_options::value_traits>::type value_traits;
|
||||||
/// @cond
|
|
||||||
static const bool external_value_traits =
|
static const bool external_value_traits =
|
||||||
detail::external_value_traits_is_true<value_traits>::value;
|
detail::external_value_traits_is_true<value_traits>::value;
|
||||||
typedef typename detail::eval_if_c
|
typedef typename detail::eval_if_c
|
||||||
@@ -2898,7 +2902,6 @@ struct make_hashtable_opt
|
|||||||
, detail::identity<value_traits>
|
, detail::identity<value_traits>
|
||||||
>::type real_value_traits;
|
>::type real_value_traits;
|
||||||
typedef typename packed_options::bucket_traits specified_bucket_traits;
|
typedef typename packed_options::bucket_traits specified_bucket_traits;
|
||||||
/// @endcond
|
|
||||||
|
|
||||||
//Real bucket traits must be calculated from options and calculated value_traits
|
//Real bucket traits must be calculated from options and calculated value_traits
|
||||||
typedef typename detail::get_slist_impl
|
typedef typename detail::get_slist_impl
|
||||||
|
@@ -50,7 +50,7 @@ class rbtree_algorithms;
|
|||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
||||||
//slist
|
//slist
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -64,7 +64,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class slist;
|
class slist;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -75,7 +75,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class slist_base_hook;
|
class slist_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -87,7 +87,7 @@ template<class ...Options>
|
|||||||
class slist_member_hook;
|
class slist_member_hook;
|
||||||
|
|
||||||
//list
|
//list
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -99,7 +99,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class list;
|
class list;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -110,7 +110,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class list_base_hook;
|
class list_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -121,8 +121,19 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class list_member_hook;
|
class list_member_hook;
|
||||||
|
|
||||||
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
|
template
|
||||||
|
< class O1 = none
|
||||||
|
, class O2 = none
|
||||||
|
, class O3 = none
|
||||||
|
>
|
||||||
|
#else
|
||||||
|
template<class ...Options>
|
||||||
|
#endif
|
||||||
|
class list_hook;
|
||||||
|
|
||||||
//rbtree/set/multiset
|
//rbtree/set/multiset
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -135,7 +146,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class rbtree;
|
class rbtree;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -148,7 +159,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class set;
|
class set;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -161,7 +172,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class multiset;
|
class multiset;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -173,7 +184,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class set_base_hook;
|
class set_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -186,7 +197,7 @@ template<class ...Options>
|
|||||||
class set_member_hook;
|
class set_member_hook;
|
||||||
|
|
||||||
//splaytree/splay_set/splay_multiset
|
//splaytree/splay_set/splay_multiset
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -199,7 +210,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class splaytree;
|
class splaytree;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -212,7 +223,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class splay_set;
|
class splay_set;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -225,7 +236,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class splay_multiset;
|
class splay_multiset;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -236,7 +247,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class splay_set_base_hook;
|
class splay_set_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -248,7 +259,7 @@ template<class ...Options>
|
|||||||
class splay_set_member_hook;
|
class splay_set_member_hook;
|
||||||
|
|
||||||
//avltree/avl_set/avl_multiset
|
//avltree/avl_set/avl_multiset
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -261,7 +272,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class avltree;
|
class avltree;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -274,7 +285,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class avl_set;
|
class avl_set;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -287,7 +298,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class avl_multiset;
|
class avl_multiset;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -299,7 +310,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class avl_set_base_hook;
|
class avl_set_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -313,7 +324,7 @@ class avl_set_member_hook;
|
|||||||
|
|
||||||
|
|
||||||
//treap/treap_set/treap_multiset
|
//treap/treap_set/treap_multiset
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -326,7 +337,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class treap;
|
class treap;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -339,7 +350,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class treap_set;
|
class treap_set;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -357,7 +368,7 @@ template <class T>
|
|||||||
struct priority_compare;
|
struct priority_compare;
|
||||||
|
|
||||||
//sgtree/sg_set/sg_multiset
|
//sgtree/sg_set/sg_multiset
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -370,7 +381,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class sgtree;
|
class sgtree;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -383,7 +394,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class sg_set;
|
class sg_set;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -396,7 +407,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class sg_multiset;
|
class sg_multiset;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -407,7 +418,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class bs_set_base_hook;
|
class bs_set_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -420,7 +431,7 @@ class bs_set_member_hook;
|
|||||||
|
|
||||||
//hashtable/unordered_set/unordered_multiset
|
//hashtable/unordered_set/unordered_multiset
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -439,7 +450,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class hashtable;
|
class hashtable;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -458,7 +469,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class unordered_set;
|
class unordered_set;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class T
|
< class T
|
||||||
, class O1 = none
|
, class O1 = none
|
||||||
@@ -477,7 +488,7 @@ template<class T, class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class unordered_multiset;
|
class unordered_multiset;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -489,7 +500,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class unordered_set_base_hook;
|
class unordered_set_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -501,7 +512,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class unordered_set_member_hook;
|
class unordered_set_member_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
@@ -512,7 +523,7 @@ template<class ...Options>
|
|||||||
#endif
|
#endif
|
||||||
class any_base_hook;
|
class any_base_hook;
|
||||||
|
|
||||||
#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
|
#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) && !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
|
||||||
template
|
template
|
||||||
< class O1 = none
|
< class O1 = none
|
||||||
, class O2 = none
|
, class O2 = none
|
||||||
|
@@ -343,6 +343,24 @@ struct member_hook
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//!This option setter specifies the function object that will
|
||||||
|
//!be used to convert between values to be inserted in a container
|
||||||
|
//!and the hook to be used for that purpose.
|
||||||
|
template< typename Functor>
|
||||||
|
struct function_hook
|
||||||
|
{
|
||||||
|
/// @cond
|
||||||
|
typedef detail::function_hook_traits
|
||||||
|
<Functor> function_value_traits;
|
||||||
|
template<class Base>
|
||||||
|
struct pack : Base
|
||||||
|
{
|
||||||
|
typedef function_value_traits value_traits;
|
||||||
|
};
|
||||||
|
/// @endcond
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//!This option setter specifies that the container
|
//!This option setter specifies that the container
|
||||||
//!must use the specified base hook
|
//!must use the specified base hook
|
||||||
template<typename BaseHook>
|
template<typename BaseHook>
|
||||||
|
42
include/boost/intrusive/parent_from_member.hpp
Normal file
42
include/boost/intrusive/parent_from_member.hpp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// (C) Copyright Ion Gaztanaga 2010-2010
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/intrusive for documentation.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#ifndef BOOST_INTRUSIVE_GET_PARENT_FROM_MEMBER_HPP
|
||||||
|
#define BOOST_INTRUSIVE_GET_PARENT_FROM_MEMBER_HPP
|
||||||
|
|
||||||
|
#include <boost/intrusive/detail/config_begin.hpp>
|
||||||
|
#include <boost/intrusive/detail/parent_from_member.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace intrusive {
|
||||||
|
|
||||||
|
//! Given a pointer to a member and its corresponding pointer to data member,
|
||||||
|
//! this function returns the pointer of the parent containing that member.
|
||||||
|
//! 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)
|
||||||
|
{ 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,
|
||||||
|
//! this function returns the const pointer of the parent containing that member.
|
||||||
|
//! 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)
|
||||||
|
{ return ::boost::intrusive::detail::parent_from_member(member, ptr_to_member); }
|
||||||
|
|
||||||
|
} //namespace intrusive {
|
||||||
|
} //namespace boost {
|
||||||
|
|
||||||
|
#include <boost/intrusive/detail/config_end.hpp>
|
||||||
|
|
||||||
|
#endif //#ifndef BOOST_INTRUSIVE_GET_PARENT_FROM_MEMBER_HPP
|
@@ -57,6 +57,9 @@
|
|||||||
#include <boost/intrusive/detail/utilities.hpp>
|
#include <boost/intrusive/detail/utilities.hpp>
|
||||||
#include <boost/intrusive/detail/tree_algorithms.hpp>
|
#include <boost/intrusive/detail/tree_algorithms.hpp>
|
||||||
|
|
||||||
|
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
|
||||||
|
#pragma optimize( "g", off )
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace intrusive {
|
namespace intrusive {
|
||||||
@@ -905,6 +908,10 @@ class rbtree_algorithms
|
|||||||
} //namespace intrusive
|
} //namespace intrusive
|
||||||
} //namespace boost
|
} //namespace boost
|
||||||
|
|
||||||
|
#if (defined _MSC_VER) && (_MSC_VER >= 1200)
|
||||||
|
#pragma optimize( "", on )
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <boost/intrusive/detail/config_end.hpp>
|
#include <boost/intrusive/detail/config_end.hpp>
|
||||||
|
|
||||||
#endif //BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
|
#endif //BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <boost/intrusive/detail/config_begin.hpp>
|
#include <boost/intrusive/detail/config_begin.hpp>
|
||||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||||
|
#include <boost/pointer_cast.hpp>
|
||||||
#include <boost/intrusive/detail/utilities.hpp>
|
#include <boost/intrusive/detail/utilities.hpp>
|
||||||
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
#include <boost/intrusive/detail/pointer_to_other.hpp>
|
||||||
#include <boost/intrusive/slist_hook.hpp>
|
#include <boost/intrusive/slist_hook.hpp>
|
||||||
@@ -76,7 +77,12 @@ struct unordered_node_traits
|
|||||||
static const bool optimize_multikey = OptimizeMultiKey;
|
static const bool optimize_multikey = OptimizeMultiKey;
|
||||||
|
|
||||||
static node_ptr get_next(const_node_ptr n)
|
static node_ptr get_next(const_node_ptr n)
|
||||||
{ return node_ptr(&static_cast<node &>(*n->next_)); }
|
{
|
||||||
|
// This still fails in gcc < 4.4 so forget about it
|
||||||
|
// using ::boost::static_pointer_cast;
|
||||||
|
// return static_pointer_cast<node>(n->next_);
|
||||||
|
return node_ptr(&static_cast<node&>(*n->next_));
|
||||||
|
}
|
||||||
|
|
||||||
static void set_next(node_ptr n, node_ptr next)
|
static void set_next(node_ptr n, node_ptr next)
|
||||||
{ n->next_ = next; }
|
{ n->next_ = next; }
|
||||||
|
Reference in New Issue
Block a user