Fixes for Boost 1.45

[SVN r65040]
This commit is contained in:
Ion Gaztañaga
2010-08-26 21:35:57 +00:00
parent 8d84a670e6
commit aba4841424
4 changed files with 34 additions and 16 deletions

View File

@@ -113,7 +113,7 @@ class avltree_impl
<pointer, node>::type node_ptr; <pointer, node>::type node_ptr;
typedef typename boost::pointer_to_other typedef typename boost::pointer_to_other
<node_ptr, const node>::type const_node_ptr; <node_ptr, const node>::type const_node_ptr;
typedef avltree_algorithms<node_traits> node_algorithms; typedef avltree_algorithms<node_traits> node_algorithms;
static const bool constant_time_size = Config::constant_time_size; static const bool constant_time_size = Config::constant_time_size;
static const bool stateful_value_traits = detail::store_cont_ptr_on_it<avltree_impl>::value; static const bool stateful_value_traits = detail::store_cont_ptr_on_it<avltree_impl>::value;
@@ -167,7 +167,7 @@ class avltree_impl
static node_ptr uncast(const_node_ptr ptr) static node_ptr uncast(const_node_ptr ptr)
{ {
return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr)));
} }
size_traits &priv_size_traits() size_traits &priv_size_traits()
@@ -1398,7 +1398,7 @@ class avltree_impl
static avltree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) static avltree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{ {
header_plus_size *r = detail::parent_from_member<header_plus_size, node> header_plus_size *r = detail::parent_from_member<header_plus_size, node>
( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_); ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
node_plus_pred_t *n = detail::parent_from_member node_plus_pred_t *n = detail::parent_from_member
<node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_); <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_); data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);

View File

@@ -49,13 +49,13 @@ struct member_value_traits
static pointer to_value_ptr(node_ptr n) static pointer to_value_ptr(node_ptr n)
{ {
return pointer(detail::parent_from_member<value_type, node> return pointer(detail::parent_from_member<value_type, node>
(detail::get_pointer(n), PtrToMember)); (detail::boost_intrusive_get_pointer(n), PtrToMember));
} }
static const_pointer to_value_ptr(const_node_ptr n) static const_pointer to_value_ptr(const_node_ptr n)
{ {
return pointer(detail::parent_from_member<value_type, node> return pointer(detail::parent_from_member<value_type, node>
(detail::get_pointer(n), PtrToMember)); (detail::boost_intrusive_get_pointer(n), PtrToMember));
} }
}; };

View File

@@ -310,7 +310,7 @@ class sgtree_impl
{ return data_.node_plus_pred_.header_plus_alpha_.header_; } { return data_.node_plus_pred_.header_plus_alpha_.header_; }
static node_ptr uncast(const_node_ptr ptr) static node_ptr uncast(const_node_ptr ptr)
{ return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); } { return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr))); }
size_traits &priv_size_traits() size_traits &priv_size_traits()
{ return data_.node_plus_pred_.size_traits_; } { return data_.node_plus_pred_.size_traits_; }
@@ -1631,7 +1631,7 @@ class sgtree_impl
static sgtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) static sgtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
{ {
header_plus_alpha *r = detail::parent_from_member<header_plus_alpha, node> header_plus_alpha *r = detail::parent_from_member<header_plus_alpha, node>
( detail::get_pointer(end_iterator.pointed_node()), &header_plus_alpha::header_); ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), &header_plus_alpha::header_);
node_plus_pred_t *n = detail::parent_from_member node_plus_pred_t *n = detail::parent_from_member
<node_plus_pred_t, header_plus_alpha>(r, &node_plus_pred_t::header_plus_alpha_); <node_plus_pred_t, header_plus_alpha>(r, &node_plus_pred_t::header_plus_alpha_);
data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_); data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);

View File

@@ -31,6 +31,7 @@
#include <algorithm> #include <algorithm>
#include <cstddef> //std::size_t #include <cstddef> //std::size_t
#include <utility> //std::pair #include <utility> //std::pair
//iG pending #include <boost/pointer_cast.hpp>
namespace boost { namespace boost {
namespace intrusive { namespace intrusive {
@@ -129,10 +130,9 @@ class slist_impl
typedef slist_iterator<slist_impl, true> const_iterator; typedef slist_iterator<slist_impl, true> const_iterator;
typedef typename real_value_traits::node_traits node_traits; typedef typename real_value_traits::node_traits node_traits;
typedef typename node_traits::node node; typedef typename node_traits::node node;
typedef typename boost::pointer_to_other typedef typename node_traits::node_ptr node_ptr;
<pointer, node>::type node_ptr; typedef typename node_traits::const_node_ptr const_node_ptr;
typedef typename boost::pointer_to_other
<pointer, const node>::type const_node_ptr;
typedef typename detail::if_c typedef typename detail::if_c
< Config::linear < Config::linear
, linear_slist_algorithms<node_traits> , linear_slist_algorithms<node_traits>
@@ -206,7 +206,8 @@ class slist_impl
{ data_.root_plus_size_.last_ = n; } { data_.root_plus_size_.last_ = n; }
static node_ptr uncast(const_node_ptr ptr) static node_ptr uncast(const_node_ptr ptr)
{ return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); } { return node_ptr(const_cast<node*>(detail::boost_intrusive_get_pointer(ptr))); }
//iG pending { return boost::const_pointer_cast<node>(ptr); }
void set_default_constructed_state() void set_default_constructed_state()
{ {
@@ -251,6 +252,22 @@ class slist_impl
real_value_traits &get_real_value_traits(detail::bool_<true>) real_value_traits &get_real_value_traits(detail::bool_<true>)
{ return data_.get_value_traits(*this); } { return data_.get_value_traits(*this); }
const value_traits &get_value_traits() const
{ return data_; }
value_traits &get_value_traits()
{ return data_; }
protected:
node &prot_root_node()
{ return data_.root_plus_size_.root_; }
node const &prot_root_node() const
{ return data_.root_plus_size_.root_; }
void prot_set_size(size_type s)
{ data_.root_plus_size_.set_size(s); }
/// @endcond /// @endcond
public: public:
@@ -1220,7 +1237,7 @@ class slist_impl
//! assigned to the last spliced element or prev if x is empty. //! assigned to the last spliced element or prev if x is empty.
//! This iterator can be used as new "prev" iterator for a new splice_after call. //! This iterator can be used as new "prev" iterator for a new splice_after call.
//! that will splice new values after the previously spliced values. //! that will splice new values after the previously spliced values.
void splice(const_iterator it, slist_impl &x, iterator *last = 0) void splice(const_iterator it, slist_impl &x, const_iterator *last = 0)
{ this->splice_after(this->previous(it), x, last); } { this->splice_after(this->previous(it), x, last); }
//! <b>Requires</b>: it p must be a valid iterator of *this. //! <b>Requires</b>: it p must be a valid iterator of *this.
@@ -1295,8 +1312,9 @@ class slist_impl
{ {
if (node_traits::get_next(node_traits::get_next(this->get_root_node())) if (node_traits::get_next(node_traits::get_next(this->get_root_node()))
!= this->get_root_node()) { != this->get_root_node()) {
slist_impl carry;
slist_impl counter[64]; slist_impl carry(this->get_value_traits());
detail::array_initializer<slist_impl, 64> counter(this->get_value_traits());
int fill = 0; int fill = 0;
const_iterator last_inserted; const_iterator last_inserted;
while(!this->empty()){ while(!this->empty()){
@@ -1879,7 +1897,7 @@ class slist_impl
//singly linked lists (because "end" is represented by the null pointer) //singly linked lists (because "end" is represented by the null pointer)
BOOST_STATIC_ASSERT(!linear); BOOST_STATIC_ASSERT(!linear);
root_plus_size *r = detail::parent_from_member<root_plus_size, node> root_plus_size *r = detail::parent_from_member<root_plus_size, node>
( detail::get_pointer(end_iterator.pointed_node()), (&root_plus_size::root_)); ( detail::boost_intrusive_get_pointer(end_iterator.pointed_node()), (&root_plus_size::root_));
data_t *d = detail::parent_from_member<data_t, root_plus_size> data_t *d = detail::parent_from_member<data_t, root_plus_size>
( r, &data_t::root_plus_size_); ( r, &data_t::root_plus_size_);
slist_impl *s = detail::parent_from_member<slist_impl, data_t>(d, &slist_impl::data_); slist_impl *s = detail::parent_from_member<slist_impl, data_t>(d, &slist_impl::data_);