名稱空間
變體
操作

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

來自 cppreference.com
< cpp‎ | ranges‎ | slide view‎ | iterator
 
 
範圍庫 (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_last_ele_ 分別為滑動視窗開頭和結尾的底層迭代器。

1) 等價於
  • return x.last_ele_ == y.last_ele_;,如果 last_ele_ 存在。否則,
  • return x.current_ == y.current_;.
2) 等價於 return x.current_ < y.current_;
3) 等價於 return y < x;
4) 等價於 return !(y < x);
5) 等價於 return !(x < y);
6) 等價於 return x.current_ <=> y.current_;

這些函式對於普通的非限定查詢限定查詢不可見,並且只有當 std::ranges::slide_view::iterator<Const> 是引數的關聯類時,才能透過實參依賴查詢找到。

!= 運算子由 operator== 合成

目錄

[編輯] 引數

x, y - 要比較的迭代器

[編輯] 返回值

比較結果。

[編輯] 示例

[編輯] 參閱

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