diff options
Diffstat (limited to 'boost/intrusive/detail/reverse_iterator.hpp')
-rw-r--r-- | boost/intrusive/detail/reverse_iterator.hpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/boost/intrusive/detail/reverse_iterator.hpp b/boost/intrusive/detail/reverse_iterator.hpp index 9f443ab4b2..6a6fee5ac2 100644 --- a/boost/intrusive/detail/reverse_iterator.hpp +++ b/boost/intrusive/detail/reverse_iterator.hpp @@ -10,19 +10,22 @@ // ///////////////////////////////////////////////////////////////////////////// -#ifndef BOOST_INTRUSIVE_DETAIL_ITERATOR_HPP -#define BOOST_INTRUSIVE_DETAIL_ITERATOR_HPP +#ifndef BOOST_INTRUSIVE_DETAIL_REVERSE_ITERATOR_HPP +#define BOOST_INTRUSIVE_DETAIL_REVERSE_ITERATOR_HPP -#if defined(_MSC_VER) +#ifndef BOOST_CONFIG_HPP +# include <boost/config.hpp> +#endif + +#if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include <boost/intrusive/detail/config_begin.hpp> -#include <boost/intrusive/detail/iiterator.hpp> +#include <boost/intrusive/detail/iterator.hpp> namespace boost { namespace intrusive { -namespace detail { template<class It> class reverse_iterator @@ -60,7 +63,7 @@ class reverse_iterator { It temp(m_current); --temp; return temp.operator->(); } reference operator[](difference_type off) const - { return this->m_current[-off]; } + { return this->m_current[-off-1]; } reverse_iterator& operator++() { --m_current; return *this; } @@ -130,10 +133,9 @@ class reverse_iterator It m_current; // the wrapped iterator }; -} //namespace detail -} //namespace intrusive -} //namespace boost +} //namespace intrusive { +} //namespace boost { #include <boost/intrusive/detail/config_end.hpp> -#endif //BOOST_INTRUSIVE_DETAIL_ITERATOR_HPP +#endif //BOOST_INTRUSIVE_DETAIL_REVERSE_ITERATOR_HPP |