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
+ , list_iterator<value_traits, false>
+ , nat>::type nonconst_iterator;
public:
typedef typename types_t::iterator_type::difference_type difference_type;
: members_(nodeptr, traits_ptr)
{}
- BOOST_INTRUSIVE_FORCEINLINE list_iterator(list_iterator<ValueTraits, false> const& other)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator(const list_iterator &other)
: members_(other.pointed_node(), other.get_value_traits())
{}
- BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator(const nonconst_iterator &other)
+ : members_(other.pointed_node(), other.get_value_traits())
+ {}
+
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const list_iterator &other)
+ { members_.nodeptr_ = other.members_.nodeptr_; return *this; }
+
+ BOOST_INTRUSIVE_FORCEINLINE node_ptr pointed_node() const
{ return members_.nodeptr_; }
BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
- { members_.nodeptr_ = node; return static_cast<list_iterator&>(*this); }
+ { members_.nodeptr_ = node; return *this; }
BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
{ return members_.get_ptr(); }
BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
- list_iterator<ValueTraits, false> unconst() const
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator<ValueTraits, false> unconst() const
{ return list_iterator<ValueTraits, false>(this->pointed_node(), this->get_value_traits()); }
private: