名稱空間
變體
操作

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

來自 cppreference.com
 
 
範圍庫 (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 - 要比較的迭代器

[編輯] 返回值

比較結果。

[編輯] 參閱

比較一個哨兵與從 enumerate_view::begin 返回的迭代器
(函式) [編輯]