operator==,<=>(ranges::enumerate_view::iterator)
來自 cppreference.com
< 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 返回的迭代器 (函式) |