diff options
Diffstat (limited to 'boost/intrusive/detail/slist_iterator.hpp')
-rw-r--r-- | boost/intrusive/detail/slist_iterator.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/boost/intrusive/detail/slist_iterator.hpp b/boost/intrusive/detail/slist_iterator.hpp index 96a5ac0191..9e72af9f39 100644 --- a/boost/intrusive/detail/slist_iterator.hpp +++ b/boost/intrusive/detail/slist_iterator.hpp @@ -49,6 +49,11 @@ class slist_iterator typedef typename types_t::node node; typedef typename types_t::node_ptr node_ptr; typedef typename types_t::const_value_traits_ptr const_value_traits_ptr; + class nat; + typedef typename + detail::if_c< IsConst + , slist_iterator<value_traits, false> + , nat>::type nonconst_iterator; public: typedef typename types_t::iterator_type::difference_type difference_type; @@ -64,10 +69,17 @@ class slist_iterator : members_(nodeptr, traits_ptr) {} - BOOST_INTRUSIVE_FORCEINLINE slist_iterator(slist_iterator<ValueTraits, false> const& other) + BOOST_INTRUSIVE_FORCEINLINE slist_iterator(const slist_iterator &other) : members_(other.pointed_node(), other.get_value_traits()) {} + BOOST_INTRUSIVE_FORCEINLINE slist_iterator(const nonconst_iterator &other) + : members_(other.pointed_node(), other.get_value_traits()) + {} + + BOOST_INTRUSIVE_FORCEINLINE slist_iterator &operator=(const slist_iterator &other) + { members_.nodeptr_ = other.members_.nodeptr_; return *this; } + BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const { return members_.nodeptr_; } |