mirror of
https://github.com/boostorg/intrusive.git
synced 2025-08-03 14:34:44 +02:00
Changed return types from reference to value due to subtle aliasing errors.
[SVN r80512]
This commit is contained in:
@@ -68,19 +68,19 @@ struct default_avltree_node_traits_impl
|
||||
|
||||
typedef typename node::balance balance;
|
||||
|
||||
static const node_ptr & get_parent(const const_node_ptr & n)
|
||||
static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return n->parent_; }
|
||||
|
||||
static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
static const node_ptr & get_left(const const_node_ptr & n)
|
||||
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)
|
||||
{ n->left_ = l; }
|
||||
|
||||
static const node_ptr & get_right(const const_node_ptr & n)
|
||||
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)
|
||||
@@ -125,13 +125,13 @@ struct compact_avltree_node_traits_impl
|
||||
static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
{ ptr_bit::set_pointer(n->parent_, p); }
|
||||
|
||||
static const node_ptr & get_left(const const_node_ptr & n)
|
||||
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)
|
||||
{ n->left_ = l; }
|
||||
|
||||
static const node_ptr & get_right(const const_node_ptr & n)
|
||||
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)
|
||||
|
@@ -44,13 +44,13 @@ struct list_node_traits
|
||||
typedef typename pointer_traits
|
||||
<VoidPointer>:: template rebind_pointer<const node>::type const_node_ptr;
|
||||
|
||||
static const node_ptr &get_previous(const const_node_ptr & n)
|
||||
static node_ptr get_previous(const const_node_ptr & n)
|
||||
{ return n->prev_; }
|
||||
|
||||
static void set_previous(const node_ptr & n, const node_ptr & prev)
|
||||
{ n->prev_ = prev; }
|
||||
|
||||
static const node_ptr &get_next(const const_node_ptr & n)
|
||||
static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return n->next_; }
|
||||
|
||||
static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
|
@@ -68,19 +68,19 @@ struct default_rbtree_node_traits_impl
|
||||
|
||||
typedef typename node::color color;
|
||||
|
||||
static const node_ptr & get_parent(const const_node_ptr & n)
|
||||
static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return n->parent_; }
|
||||
|
||||
static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
static const node_ptr & get_left(const const_node_ptr & n)
|
||||
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)
|
||||
{ n->left_ = l; }
|
||||
|
||||
static const node_ptr & get_right(const const_node_ptr & n)
|
||||
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)
|
||||
@@ -120,13 +120,13 @@ struct compact_rbtree_node_traits_impl
|
||||
static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
{ ptr_bit::set_pointer(n->parent_, p); }
|
||||
|
||||
static const node_ptr & get_left(const const_node_ptr & n)
|
||||
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)
|
||||
{ n->left_ = l; }
|
||||
|
||||
static const node_ptr & get_right(const const_node_ptr & n)
|
||||
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)
|
||||
|
@@ -42,7 +42,7 @@ struct slist_node_traits
|
||||
typedef typename pointer_traits
|
||||
<VoidPointer>::template rebind_pointer<const node>::type const_node_ptr;
|
||||
|
||||
static const node_ptr &get_next(const const_node_ptr & n)
|
||||
static node_ptr get_next(const const_node_ptr & n)
|
||||
{ return n->next_; }
|
||||
|
||||
static void set_next(const node_ptr & n, const node_ptr & next)
|
||||
|
@@ -41,19 +41,19 @@ struct tree_node_traits
|
||||
typedef typename pointer_traits<VoidPointer>::template
|
||||
rebind_pointer<const node>::type const_node_ptr;
|
||||
|
||||
static const node_ptr & get_parent(const const_node_ptr & n)
|
||||
static node_ptr get_parent(const const_node_ptr & n)
|
||||
{ return n->parent_; }
|
||||
|
||||
static void set_parent(const node_ptr & n, const node_ptr & p)
|
||||
{ n->parent_ = p; }
|
||||
|
||||
static const node_ptr & get_left(const const_node_ptr & n)
|
||||
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)
|
||||
{ n->left_ = l; }
|
||||
|
||||
static const node_ptr & get_right(const const_node_ptr & n)
|
||||
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)
|
||||
|
@@ -170,7 +170,7 @@ struct pointer_traits
|
||||
|
||||
template<class UPtr>
|
||||
static pointer priv_static_cast_from(boost::false_type, const UPtr &uptr)
|
||||
{ return pointer_to(static_cast<element_type&>(*uptr)); }
|
||||
{ return pointer_to(*static_cast<element_type*>(to_raw_pointer(uptr))); }
|
||||
|
||||
//priv_const_cast_from
|
||||
template<class UPtr>
|
||||
|
Reference in New Issue
Block a user