]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/intrusive/detail/list_iterator.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / intrusive / detail / list_iterator.hpp
index 6c5f1616758fe810d0f9b062976d1a00dbde2341..880b6a984798a0c5e352fe206776922e87da6603 100644 (file)
@@ -47,6 +47,11 @@ class list_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
+                  , list_iterator<value_traits, false>
+                  , nat>::type                              nonconst_iterator;
 
    public:
    typedef typename types_t::iterator_type::difference_type    difference_type;
@@ -62,15 +67,22 @@ class list_iterator
       : 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(); }
@@ -115,7 +127,7 @@ class list_iterator
    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: