diff --git a/include/boost/intrusive/slist.hpp b/include/boost/intrusive/slist.hpp index 51ab1bd..23c7824 100644 --- a/include/boost/intrusive/slist.hpp +++ b/include/boost/intrusive/slist.hpp @@ -1700,7 +1700,7 @@ class slist_impl //! Note: Iterators and references are not invalidated. 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()); } @@ -1715,7 +1715,7 @@ class slist_impl //! Note: Iterators and references are not invalidated. const_iterator iterator_to(const_reference value) const { - BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(this->priv_value_traits().to_node_ptr(const_cast (value)))); + BOOST_INTRUSIVE_INVARIANT_ASSERT (linear || !node_algorithms::inited(this->priv_value_traits().to_node_ptr(const_cast (value)))); return const_iterator(this->priv_value_traits().to_node_ptr(const_cast (value)), this->value_traits_ptr()); }