Namespaces
Variants

operator==,<,>,<=,>=,<=> (ranges::adjacent_view:: iterator )

From cppreference.net
Ranges library
Range adaptors
friend constexpr bool operator == ( const /*iterator*/ & x, const /*iterator*/ & y ) ;
(1) (自 C++23 起)
friend constexpr bool operator < ( const /*iterator*/ & x, const /*iterator*/ & y )
requires ranges:: random_access_range < Base > ;
(2) (自 C++23 起)
friend constexpr bool operator > ( const /*iterator*/ & x, const /*iterator*/ & y )
requires ranges:: random_access_range < Base > ;
(3) (自 C++23 起)
friend constexpr bool operator <= ( const /*iterator*/ & x, const /*iterator*/ & y )
requires ranges:: random_access_range < Base > ;
(4) (自 C++23 起)
friend constexpr bool operator >= ( const /*iterator*/ & x, const /*iterator*/ & y )
requires ranges:: random_access_range < Base > ;
(5) (自 C++23 起)
friend constexpr auto operator <=> ( const /*iterator*/ & x, const /*iterator*/ & y )

requires ranges:: random_access_range < Base > &&

std:: three_way_comparable < ranges:: iterator_t < Base >> ;
(6) (自 C++23 起)

比较底层迭代器。令 current_ 为底层迭代器数组。

1) 等价于 return x. current_ . back ( ) == y. current_ . back ( )
2) 等价于 return x. current_ . back ( ) < y. current_ . back ( )
3) 等价于 return y < x ;
4) 等价于 return ! ( y < x ) ;
5) 等价于 return ! ( x < y ) ;
6) 等价于 return x. base ( ) <=> y. base ( ) ;

这些函数对普通的 非限定查找 限定查找 不可见,仅当 std::ranges::adjacent_view:: iterator <Const> 作为参数的关联类时,才能通过 实参依赖查找 找到。

!= 运算符由 operator== 合成 而来。

参数

x, y - 待比较的迭代器

返回值

比较结果。

参见

(C++23)
比较哨位与从 adjacent_view::begin 返回的迭代器
(函数)