summaryrefslogtreecommitdiff
path: root/boost/intrusive/detail/list_iterator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/intrusive/detail/list_iterator.hpp')
-rw-r--r--boost/intrusive/detail/list_iterator.hpp43
1 files changed, 22 insertions, 21 deletions
diff --git a/boost/intrusive/detail/list_iterator.hpp b/boost/intrusive/detail/list_iterator.hpp
index 6af4841c3e..6c5f161675 100644
--- a/boost/intrusive/detail/list_iterator.hpp
+++ b/boost/intrusive/detail/list_iterator.hpp
@@ -22,6 +22,7 @@
# pragma once
#endif
+#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/std_fwd.hpp>
#include <boost/intrusive/detail/iiterator.hpp>
#include <boost/intrusive/detail/mpl.hpp>
@@ -48,80 +49,80 @@ class list_iterator
typedef typename types_t::const_value_traits_ptr const_value_traits_ptr;
public:
- typedef typename types_t::iterator_traits::difference_type difference_type;
- typedef typename types_t::iterator_traits::value_type value_type;
- typedef typename types_t::iterator_traits::pointer pointer;
- typedef typename types_t::iterator_traits::reference reference;
- typedef typename types_t::iterator_traits::iterator_category iterator_category;
+ typedef typename types_t::iterator_type::difference_type difference_type;
+ typedef typename types_t::iterator_type::value_type value_type;
+ typedef typename types_t::iterator_type::pointer pointer;
+ typedef typename types_t::iterator_type::reference reference;
+ typedef typename types_t::iterator_type::iterator_category iterator_category;
- list_iterator()
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator()
{}
- explicit list_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
+ BOOST_INTRUSIVE_FORCEINLINE explicit list_iterator(const node_ptr & nodeptr, const const_value_traits_ptr &traits_ptr)
: members_(nodeptr, traits_ptr)
{}
- list_iterator(list_iterator<ValueTraits, false> const& other)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator(list_iterator<ValueTraits, false> const& other)
: members_(other.pointed_node(), other.get_value_traits())
{}
- const node_ptr &pointed_node() const
+ BOOST_INTRUSIVE_FORCEINLINE const node_ptr &pointed_node() const
{ return members_.nodeptr_; }
- list_iterator &operator=(const node_ptr &node)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator &operator=(const node_ptr &node)
{ members_.nodeptr_ = node; return static_cast<list_iterator&>(*this); }
- const_value_traits_ptr get_value_traits() const
+ BOOST_INTRUSIVE_FORCEINLINE const_value_traits_ptr get_value_traits() const
{ return members_.get_ptr(); }
public:
- list_iterator& operator++()
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator& operator++()
{
node_ptr p = node_traits::get_next(members_.nodeptr_);
members_.nodeptr_ = p;
return static_cast<list_iterator&> (*this);
}
- list_iterator operator++(int)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator operator++(int)
{
list_iterator result (*this);
members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
return result;
}
- list_iterator& operator--()
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator& operator--()
{
members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
return static_cast<list_iterator&> (*this);
}
- list_iterator operator--(int)
+ BOOST_INTRUSIVE_FORCEINLINE list_iterator operator--(int)
{
list_iterator result (*this);
members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
return result;
}
- friend bool operator== (const list_iterator& l, const list_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator== (const list_iterator& l, const list_iterator& r)
{ return l.pointed_node() == r.pointed_node(); }
- friend bool operator!= (const list_iterator& l, const list_iterator& r)
+ BOOST_INTRUSIVE_FORCEINLINE friend bool operator!= (const list_iterator& l, const list_iterator& r)
{ return !(l == r); }
- reference operator*() const
+ BOOST_INTRUSIVE_FORCEINLINE reference operator*() const
{ return *operator->(); }
- pointer operator->() const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator->() const
{ return this->operator_arrow(detail::bool_<stateful_value_traits>()); }
list_iterator<ValueTraits, false> unconst() const
{ return list_iterator<ValueTraits, false>(this->pointed_node(), this->get_value_traits()); }
private:
- pointer operator_arrow(detail::false_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::false_) const
{ return ValueTraits::to_value_ptr(members_.nodeptr_); }
- pointer operator_arrow(detail::true_) const
+ BOOST_INTRUSIVE_FORCEINLINE pointer operator_arrow(detail::true_) const
{ return this->get_value_traits()->to_value_ptr(members_.nodeptr_); }
iiterator_members<node_ptr, const_value_traits_ptr, stateful_value_traits> members_;