operator==,!=,<,<=,>,>=,<=>(std::move_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::move_iterator<Iterator1>& lhs,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                           const std::move_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::move_iterator<Iterator1>& x,

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

Compares the underlying iterators.

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

(since C++20)

Parameters

lhs, rhs - iterator adaptors to compare

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) lhs.base() <=> rhs.base()

Example