Changed return types from reference to value due to subtle aliasing errors.

[SVN r80512]
This commit is contained in:
Ion Gaztañaga
2012-09-13 18:52:35 +00:00
parent 9fa6fbd3a0
commit 22e6899bdc
6 changed files with 17 additions and 17 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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>