Namespaces
Variants

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

From cppreference.net
Ranges library
Range adaptors
friend constexpr bool
operator == ( const /*iterator*/ & x, const /*iterator*/ & y ) noexcept ;
(1) (自 C++23 起)
friend constexpr std:: strong_ordering
operator <=> ( const /*iterator*/ & x, const /*iterator*/ & y ) noexcept ;
(2) (自 C++23 起)

比较底层的 迭代器 。令 pos_ 表示底层索引。

1) 等价于 return x. pos_ == y. pos_ ;
2) 等价于 return x. pos_ <=> y. pos_ ;

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

< <= > >= != 运算符分别由 operator <=> operator == 合成。

参数

x, y - 待比较的迭代器

返回值

比较结果。

参见

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