名稱空間
變體
操作

std::ranges::iota_view<W, Bound>::sentinel

來自 cppreference.com
< cpp‎ | ranges‎ | iota view
 
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
struct /*sentinel*/;
(僅作說明*)

ranges::iota_view<W, Bound>::sentinelranges::iota_view<W, Bound>end() 返回的可達哨兵型別。

目錄

[編輯] 資料成員

成員 定義
Bound bound_ 哨兵值
(僅用於闡釋的成員物件*)

[編輯] 成員函式

std::ranges::iota_view::sentinel::sentinel

/*sentinel*/() = default;
(1) (C++20 起)
constexpr explicit /*sentinel*/( Bound bound );
(2) (C++20 起)
1) 值初始化 bound_
2)bound 初始化 bound_

[編輯] 非成員函式

operator==(std::ranges::iota_view::iterator, std::ranges::iota_view::sentinel)

friend constexpr bool operator==( const /*iterator*/& x,
                                  const /*sentinel*/& y );
(C++20 起)

返回 x.value_ == y.bound_

!= 運算子由 operator== 合成

此函式對普通的非限定限定查詢不可見,僅當 sentinel 是實參的關聯類時,才能透過實參依賴查詢找到。

operator-(std::ranges::iota_view::iterator, std::ranges::iota_view::sentinel)

friend constexpr std::iter_difference_t<W>

    operator-(const /*iterator*/& x, const /*sentinel*/& y)

    requires std::sized_sentinel_for<Bound, W>;
(1) (C++20 起)
friend constexpr std::iter_difference_t<W>

    operator-(const /*sentinel*/& x, const /*iterator*/& y)

    requires std::sized_sentinel_for<Bound, W>;
(2) (C++20 起)
1) 返回 x.value_ - y.bound_
2) 返回 -(y.value_ - x.bound_ )

這些函式對普通的非限定限定查詢不可見,僅當 sentinel 是實參的關聯類時,才能透過實參依賴查詢找到。

[編輯] 示例