Namespaces
Variants
Views
Actions

operator==,!=,<,<=,>,>=,<=>(std::reverse_iterator)

From cppreference.com
 
 
Iterator library
Iterator concepts
Iterator primitives
Iterator adaptors
Stream iterators
Iterator customization points
Iterator operations
(C++11)
(C++11)
Range access
(C++11)(C++14)
(C++11)(C++14)
(C++17)(C++20)
(C++14)(C++14)
(C++14)(C++14)
(C++17)
(C++17)
 
 
(1)
template< class Iterator1, class Iterator2 >

bool operator==( const std::reverse_iterator<Iterator1>& lhs,

                 const std::reverse_iterator<Iterator2>& rhs );
(until C++17)
template< class Iterator1, class Iterator2 >

constexpr bool operator==( const std::reverse_iterator<Iterator1>& lhs,

                           const std::reverse_iterator<Iterator2>& rhs );
(since C++17)
(2)
template< class Iterator1, class Iterator2 >

bool operator!=( const std::reverse_iterator<Iterator1>& lhs,

                 const std::reverse_iterator<Iterator2>& rhs );
(until C++17)
template< class Iterator1, class Iterator2 >

constexpr bool operator!=( const std::reverse_iterator<Iterator1>& lhs,

                           const std::reverse_iterator<Iterator2>& rhs );
(since C++17)
(3)
template< class Iterator1, class Iterator2 >

bool operator<( const std::reverse_iterator<Iterator1>& lhs,

                const std::reverse_iterator<Iterator2>& rhs );
(until C++17)
template< class Iterator1, class Iterator2 >

constexpr bool operator<( const std::reverse_iterator<Iterator1>& lhs,

                          const std::reverse_iterator<Iterator2>& rhs );
(since C++17)
(4)
template< class Iterator1, class Iterator2 >

bool operator<=( const std::reverse_iterator<Iterator1>& lhs,

                 const std::reverse_iterator<Iterator2>& rhs );
(until C++17)
template< class Iterator1, class Iterator2 >

constexpr bool operator<=( const std::reverse_iterator<Iterator1>& lhs,

                           const std::reverse_iterator<Iterator2>& rhs );
(since C++17)
(5)
template< class Iterator1, class Iterator2 >

bool operator>( const std::reverse_iterator<Iterator1>& lhs,

                const std::reverse_iterator<Iterator2>& rhs );
(until C++17)
template< class Iterator1, class Iterator2 >

constexpr bool operator>( const std::reverse_iterator<Iterator1>& lhs,

                          const std::reverse_iterator<Iterator2>& rhs );
(since C++17)
(6)
template< class Iterator1, class Iterator2 >

bool operator>=( const std::reverse_iterator<Iterator1>& lhs,

                 const std::reverse_iterator<Iterator2>& rhs );
(until C++17)
template< class Iterator1, class Iterator2 >

constexpr bool operator>=( const std::reverse_iterator<Iterator1>& lhs,

                           const std::reverse_iterator<Iterator2>& rhs );
(since C++17)
template<class Iterator1, std::three_way_comparable_with<Iterator1> Iterator2>

constexpr std::compare_three_way_result_t<Iterator1, Iterator2>
    operator<=>( const std::reverse_iterator<Iterator1>& x,

                 const std::reverse_iterator<Iterator2>& y );
(7) (since C++20)

Compares the underlying iterators. Inverse comparisons are applied in order to take into account that the iterator order is reversed.

(1-6) only participate in overload resolution if their underlying comparison expressions (see below) are well-formed and convertible to bool.

(since C++20)

[edit] Parameters

lhs, rhs - iterator adaptors to compare

[edit] Return Value

1) lhs.base() == rhs.base()
2) lhs.base() != rhs.base()
3) lhs.base() > rhs.base()
4) lhs.base() >= rhs.base()
5) lhs.base() < rhs.base()
6) lhs.base() <= rhs.base()
7) rhs.base() <=> lhs.base()

[edit] Example