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

来自cppreference.com

 
 
迭代器库
迭代器概念
迭代器原语
迭代器适配器
流迭代器
迭代器定制点
迭代器操作
(C++11)
(C++11)
范围访问
(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 reverse_iterator<Iterator1>& lhs,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                           const reverse_iterator<Iterator2>& rhs );
(C++17 起)

比较底层迭代器。考虑到迭代器顺序是逆向的,而应用逆向比较。

参数

lhs, rhs - 要比较的迭代器适配器

返回值

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

示例