forked from boostorg/intrusive
Merge branch 'no-const_cast' of https://github.com/mateidavid/intrusive into mateidavid-no-const_cast
This commit is contained in:
@@ -183,14 +183,14 @@ struct bstbase3
|
|||||||
static const_iterator s_iterator_to(const_reference value)
|
static const_iterator s_iterator_to(const_reference value)
|
||||||
{
|
{
|
||||||
BOOST_STATIC_ASSERT((!stateful_value_traits));
|
BOOST_STATIC_ASSERT((!stateful_value_traits));
|
||||||
return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), const_value_traits_ptr());
|
return const_iterator (value_traits::to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), const_value_traits_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator iterator_to(reference value)
|
iterator iterator_to(reference value)
|
||||||
{ return iterator (this->get_value_traits().to_node_ptr(value), this->value_traits_ptr()); }
|
{ return iterator (this->get_value_traits().to_node_ptr(value), this->value_traits_ptr()); }
|
||||||
|
|
||||||
const_iterator iterator_to(const_reference value) const
|
const_iterator iterator_to(const_reference value) const
|
||||||
{ return const_iterator (this->get_value_traits().to_node_ptr(const_cast<reference> (value)), this->value_traits_ptr()); }
|
{ return const_iterator (this->get_value_traits().to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), this->value_traits_ptr()); }
|
||||||
|
|
||||||
static void init_node(reference value)
|
static void init_node(reference value)
|
||||||
{ node_algorithms::init(value_traits::to_node_ptr(value)); }
|
{ node_algorithms::init(value_traits::to_node_ptr(value)); }
|
||||||
|
@@ -1213,8 +1213,8 @@ class list_impl
|
|||||||
static const_iterator s_iterator_to(const_reference value)
|
static const_iterator s_iterator_to(const_reference value)
|
||||||
{
|
{
|
||||||
BOOST_STATIC_ASSERT((!stateful_value_traits));
|
BOOST_STATIC_ASSERT((!stateful_value_traits));
|
||||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(value_traits::to_node_ptr(const_cast<reference> (value))));
|
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(value_traits::to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value)))));
|
||||||
return const_iterator(value_traits::to_node_ptr(const_cast<reference> (value)), const_value_traits_ptr());
|
return const_iterator(value_traits::to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), const_value_traits_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
|
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
|
||||||
@@ -1243,8 +1243,8 @@ class list_impl
|
|||||||
//! <b>Note</b>: Iterators and references are not invalidated.
|
//! <b>Note</b>: Iterators and references are not invalidated.
|
||||||
const_iterator iterator_to(const_reference value) const
|
const_iterator iterator_to(const_reference value) const
|
||||||
{
|
{
|
||||||
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(this->priv_value_traits().to_node_ptr(const_cast<reference> (value))));
|
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(this->priv_value_traits().to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value)))));
|
||||||
return const_iterator(this->priv_value_traits().to_node_ptr(const_cast<reference> (value)), value_traits_ptr());
|
return const_iterator(this->priv_value_traits().to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), value_traits_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @cond
|
/// @cond
|
||||||
|
@@ -1685,7 +1685,7 @@ class slist_impl
|
|||||||
static const_iterator s_iterator_to(const_reference value)
|
static const_iterator s_iterator_to(const_reference value)
|
||||||
{
|
{
|
||||||
BOOST_STATIC_ASSERT((!stateful_value_traits));
|
BOOST_STATIC_ASSERT((!stateful_value_traits));
|
||||||
return const_iterator(value_traits::to_node_ptr(const_cast<reference> (value)), const_value_traits_ptr());
|
return const_iterator(value_traits::to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), const_value_traits_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
|
//! <b>Requires</b>: value must be a reference to a value inserted in a list.
|
||||||
@@ -1714,8 +1714,8 @@ class slist_impl
|
|||||||
//! <b>Note</b>: Iterators and references are not invalidated.
|
//! <b>Note</b>: Iterators and references are not invalidated.
|
||||||
const_iterator iterator_to(const_reference value) const
|
const_iterator iterator_to(const_reference value) const
|
||||||
{
|
{
|
||||||
BOOST_INTRUSIVE_INVARIANT_ASSERT (linear || !node_algorithms::inited(this->priv_value_traits().to_node_ptr(const_cast<reference> (value))));
|
BOOST_INTRUSIVE_INVARIANT_ASSERT (linear || !node_algorithms::inited(this->priv_value_traits().to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value)))));
|
||||||
return const_iterator(this->priv_value_traits().to_node_ptr(const_cast<reference> (value)), this->value_traits_ptr());
|
return const_iterator(this->priv_value_traits().to_node_ptr(*pointer_traits<pointer>::const_cast_from(pointer_traits<const_pointer>::pointer_to(value))), this->value_traits_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Returns</b>: The iterator to the element before i in the list.
|
//! <b>Returns</b>: The iterator to the element before i in the list.
|
||||||
|
Reference in New Issue
Block a user