Fix wrong assertion when linear lists where used.

This commit is contained in:
Ion Gaztañaga
2014-02-23 13:43:30 +01:00
parent 67c8eef8b4
commit bd9f607af4

View File

@@ -1700,7 +1700,7 @@ class slist_impl
//! <b>Note</b>: Iterators and references are not invalidated. //! <b>Note</b>: Iterators and references are not invalidated.
iterator iterator_to(reference value) iterator iterator_to(reference value)
{ {
BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(this->priv_value_traits().to_node_ptr(value))); BOOST_INTRUSIVE_INVARIANT_ASSERT(linear || !node_algorithms::inited(this->priv_value_traits().to_node_ptr(value)));
return iterator (this->priv_value_traits().to_node_ptr(value), this->value_traits_ptr()); return iterator (this->priv_value_traits().to_node_ptr(value), this->value_traits_ptr());
} }
@@ -1715,7 +1715,7 @@ 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 (!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(const_cast<reference> (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(const_cast<reference> (value)), this->value_traits_ptr());
} }