##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

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

From cppreference.com
< cpp‎ | iterator‎ | reverse iterator

[edit template]

| (1) |
template< class Iterator1, class Iterator2 > bool operator==( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (until C++17)
template< class Iterator1, class Iterator2 > constexpr bool operator==( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (since C++17)
| (2) |
template< class Iterator1, class Iterator2 > bool operator!=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (until C++17)
template< class Iterator1, class Iterator2 > constexpr bool operator!=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (since C++17)
| (3) |
template< class Iterator1, class Iterator2 > bool operator<( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (until C++17)
template< class Iterator1, class Iterator2 > constexpr bool operator<( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (since C++17)
| (4) |
template< class Iterator1, class Iterator2 > bool operator<=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (until C++17)
template< class Iterator1, class Iterator2 > constexpr bool operator<=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (since C++17)
| (5) |
template< class Iterator1, class Iterator2 > bool operator>( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (until C++17)
template< class Iterator1, class Iterator2 > constexpr bool operator>( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (since C++17)
| (6) |
template< class Iterator1, class Iterator2 > bool operator>=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (until C++17)
template< class Iterator1, class Iterator2 > constexpr bool operator>=( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ); |  | (since C++17)

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

### [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()

### [edit] Example

| This section is incomplete Reason: no example

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/iterator/reverse_iterator/operator_cmp&oldid=50889"
Category:

- Todo no example