##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# operator-(reverse_iterator)

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

[edit template]

template< class Iterator > typename reverse_iterator<Iterator>::difference_type operator-( const reverse_iterator<Iterator>& lhs, const reverse_iterator<Iterator>& rhs ); |  | (until C++11)
template< class Iterator1, class Iterator2 > auto operator-( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ) -> decltype(rhs.base() - lhs.base()); |  | (since C++11) (until C++17)
template< class Iterator1, class Iterator2 > constexpr auto operator-( const reverse_iterator<Iterator1>& lhs, const reverse_iterator<Iterator2>& rhs ) -> decltype(rhs.base() - lhs.base()); |  | (since C++17)

Returns the distance between two iterator adaptors.

### [edit] Parameters

lhs, rhs | - | iterator adaptors to compute the difference of

### [edit] Return value

rhs.base() - lhs.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-&oldid=50886"
Category:

- Todo no example