operator==,<=>(ranges::enumerate_view::iterator)
来自 cppreference.cn
< cpp | ranges | enumerate view | iterator
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 起) |
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 返回的迭代器 (函数) |