forked from boostorg/intrusive
* Deleted dependencies with <boost/pointer_cast.hpp> and <boost/pointer_to_other.hpp>. pointer_traits is used to obtain pointer-related types and operations.
* Added examples for derivation_value_traits and member_value_traits and updated configuration.
This commit is contained in:
1 parent
1ad883bddd
commit
29aa25d8e9
12 files changed
+130
-60
No files matched your search
@@ -15,11 +15,8 @@
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/pointer_cast.hpp>
|
||||
#include <boost/pointer_to_other.hpp>
|
||||
#include <iterator>
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
@@ -41,8 +38,10 @@ struct derivation_value_traits
|
||||
typedef typename node_traits::node node;
|
||||
typedef typename node_traits::node_ptr node_ptr;
|
||||
typedef typename node_traits::const_node_ptr const_node_ptr;
|
||||
typedef typename boost::pointer_to_other<node_ptr, T>::type pointer;
|
||||
typedef typename boost::pointer_to_other<node_ptr, const T>::type const_pointer;
|
||||
typedef typename pointer_traits<node_ptr>::
|
||||
template rebind_pointer<value_type>::type pointer;
|
||||
typedef typename pointer_traits<node_ptr>::
|
||||
template rebind_pointer<const value_type>::type const_pointer;
|
||||
typedef typename boost::intrusive::
|
||||
pointer_traits<pointer>::reference reference;
|
||||
typedef typename boost::intrusive::
|
||||
@@ -57,18 +56,12 @@ struct derivation_value_traits
|
||||
|
||||
static pointer to_value_ptr(const node_ptr &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));
|
||||
return pointer_traits<pointer>::pointer_to(static_cast<reference>(*n));
|
||||
}
|
||||
|
||||
static const_pointer to_value_ptr(const const_node_ptr &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));
|
||||
return pointer_traits<pointer>::pointer_to(static_cast<const_reference>(*n));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <cstddef>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/pointer_cast.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace intrusive {
|
||||
|
||||
@@ -20,13 +20,11 @@
|
||||
#include <boost/intrusive/circular_list_algorithms.hpp>
|
||||
#include <boost/intrusive/detail/mpl.hpp>
|
||||
#include <boost/intrusive/detail/utilities.hpp>
|
||||
#include <boost/intrusive/slist.hpp> //remove-me
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <boost/intrusive/slist.hpp> //make_slist
|
||||
#include <boost/intrusive/trivial_value_traits.hpp>
|
||||
#include <cstddef>
|
||||
#include <climits>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/pointer_cast.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include <boost/intrusive/detail/assert.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/pointer_cast.hpp>
|
||||
//General intrusive utilities
|
||||
#include <boost/intrusive/detail/hashtable_node.hpp>
|
||||
#include <boost/intrusive/detail/transform_iterator.hpp>
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
|
||||
#include <boost/intrusive/link_mode.hpp>
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
|
||||
#include <boost/intrusive/detail/config_begin.hpp>
|
||||
#include <boost/intrusive/intrusive_fwd.hpp>
|
||||
#include <boost/pointer_cast.hpp>
|
||||
#include <boost/intrusive/detail/utilities.hpp>
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <boost/intrusive/slist_hook.hpp>
|
||||
#include <boost/intrusive/options.hpp>
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <boost/intrusive/detail/generic_hook.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
Reference in new issue
Block a user