Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Struct template reverse_iterator

boost::stl_interfaces::v1::reverse_iterator

Synopsis

// In header: <boost/stl_interfaces/reverse_iterator.hpp>

template<typename BidiIter> 
struct reverse_iterator : public boost::stl_interfaces::v1::iterator_interface< reverse_iterator< BidiIter >, std::iterator_traits< BidiIter >::iterator_category, std::iterator_traits< BidiIter >::value_type, std::iterator_traits< BidiIter >::reference, std::iterator_traits< BidiIter >::pointer, std::iterator_traits< BidiIter >::difference_type >
{
  // construct/copy/destruct
  reverse_iterator() noexcept(noexcept(BidiIter())));
  reverse_iterator(BidiIter) noexcept(noexcept(BidiIter(it))));
  template<typename BidiIter2, 
           typename E = std::enable_if_t<                std::is_convertible<BidiIter2, BidiIter>::value> > 
    reverse_iterator(reverse_iterator< BidiIter2 > const &);

  // friend functions
  template<typename BidiIter2> friend struct reverse_iterator();

  // public member functions
  constexpr std::iterator_traits< BidiIter >::reference 
  operator *() const noexcept(noexcept(std::prev(v1_dtl::ce_prev(std::declval< BidiIter & >())))));
  constexpr reverse_iterator & 
  operator+=(typename std::iterator_traits< BidiIter >::difference_type) noexcept(noexcept(v1_dtl::ce_adv(std::declval< BidiIter & >(), -n, typename std::iterator_traits< BidiIter >::iterator_category{}))));
  constexpr BidiIter base() const noexcept;

  // private member functions
  constexpr BidiIter & base_reference() noexcept;
  constexpr BidiIter const  & base_reference() const noexcept;
};

Description

This type is very similar to the C++20 version of std::reverse_iterator; it is constexpr-, noexcept-, and proxy-friendly.

reverse_iterator public construct/copy/destruct

  1. reverse_iterator() noexcept(noexcept(BidiIter())));
  2. reverse_iterator(BidiIter it) noexcept(noexcept(BidiIter(it))));
  3. template<typename BidiIter2, 
             typename E = std::enable_if_t<                std::is_convertible<BidiIter2, BidiIter>::value> > 
      reverse_iterator(reverse_iterator< BidiIter2 > const & it);

reverse_iterator friend functions

  1. template<typename BidiIter2> friend struct reverse_iterator();

    A template alias for std::reverse_iterator. This only exists to make migration from Boost.STLInterfaces to C++20 easier; switch to the one in std as soon as you can.

reverse_iterator public member functions

  1. constexpr std::iterator_traits< BidiIter >::reference 
    operator *() const noexcept(noexcept(std::prev(v1_dtl::ce_prev(std::declval< BidiIter & >())))));
  2. constexpr reverse_iterator & 
    operator+=(typename std::iterator_traits< BidiIter >::difference_type n) noexcept(noexcept(v1_dtl::ce_adv(std::declval< BidiIter & >(), -n, typename std::iterator_traits< BidiIter >::iterator_category{}))));
  3. constexpr BidiIter base() const noexcept;

reverse_iterator private member functions

  1. constexpr BidiIter & base_reference() noexcept;
  2. constexpr BidiIter const  & base_reference() const noexcept;

PrevUpHomeNext