[reverse.iter.cmp]

# 24 Iterators library [[iterators]](./#iterators)

## 24.5 Iterator adaptors [[predef.iterators]](predef.iterators#reverse.iter.cmp)

### 24.5.1 Reverse iterators [[reverse.iterators]](reverse.iterators#reverse.iter.cmp)

#### 24.5.1.8 Comparisons [reverse.iter.cmp]

[ð](#lib:operator==,reverse_iterator)

`template<class Iterator1, class Iterator2>
  constexpr bool operator==(
    const reverse_iterator<Iterator1>& x,
    const reverse_iterator<Iterator2>& y);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3555)

*Constraints*: x.base() == y.base() is well-formed and
convertible to bool[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3560)

*Returns*: x.base() == y.base()[.](#2.sentence-1)

[ð](#lib:operator!=,reverse_iterator)

`template<class Iterator1, class Iterator2>
  constexpr bool operator!=(
    const reverse_iterator<Iterator1>& x,
    const reverse_iterator<Iterator2>& y);
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3574)

*Constraints*: x.base() != y.base() is well-formed and
convertible to bool[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3579)

*Returns*: x.base() != y.base()[.](#4.sentence-1)

[ð](#lib:operator%3c,reverse_iterator)

`template<class Iterator1, class Iterator2>
  constexpr bool operator<(
    const reverse_iterator<Iterator1>& x,
    const reverse_iterator<Iterator2>& y);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3593)

*Constraints*: x.base() > y.base() is well-formed and
convertible to bool[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3598)

*Returns*: x.base() > y.base()[.](#6.sentence-1)

[ð](#lib:operator%3e,reverse_iterator)

`template<class Iterator1, class Iterator2>
  constexpr bool operator>(
    const reverse_iterator<Iterator1>& x,
    const reverse_iterator<Iterator2>& y);
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3612)

*Constraints*: x.base() < y.base() is well-formed and
convertible to bool[.](#7.sentence-1)

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3617)

*Returns*: x.base() < y.base()[.](#8.sentence-1)

[ð](#lib:operator%3c=,reverse_iterator)

`template<class Iterator1, class Iterator2>
  constexpr bool operator<=(
    const reverse_iterator<Iterator1>& x,
    const reverse_iterator<Iterator2>& y);
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3631)

*Constraints*: x.base() >= y.base() is well-formed and
convertible to bool[.](#9.sentence-1)

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3636)

*Returns*: x.base() >= y.base()[.](#10.sentence-1)

[ð](#lib:operator%3e=,reverse_iterator)

`template<class Iterator1, class Iterator2>
  constexpr bool operator>=(
    const reverse_iterator<Iterator1>& x,
    const reverse_iterator<Iterator2>& y);
`

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3650)

*Constraints*: x.base() <= y.base() is well-formed and
convertible to bool[.](#11.sentence-1)

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3655)

*Returns*: x.base() <= y.base()[.](#12.sentence-1)

[ð](#lib:operator%3c=%3e,reverse_iterator)

`template<class Iterator1, [three_way_comparable_with](cmp.concept#concept:three_way_comparable_with "17.12.4 Concept three_­way_­comparable [cmp.concept]")<Iterator1> Iterator2>
  constexpr compare_three_way_result_t<Iterator1, Iterator2>
    operator<=>(const reverse_iterator<Iterator1>& x,
                const reverse_iterator<Iterator2>& y);
`

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3669)

*Returns*: y.base() <=> x.base()[.](#13.sentence-1)

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L3673)

[*Note [1](#note-1)*:

The argument order in the *Returns*: element is reversed
because this is a reverse iterator[.](#14.sentence-1)

â *end note*]
