Namespaces
Variants

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

From cppreference.net
Ranges library
Range adaptors
struct /*sentinel*/ ;
( 仅用于说明* )

ranges:: iota_view < W, Bound > :: sentinel 是通过 ranges:: iota_view < W, Bound > end() 返回的可达哨兵类型。

目录

数据成员

成员 定义
Bound bound_ 哨兵值
( 仅用于说明的成员对象* )

成员函数

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

/*sentinel*/ ( ) = default ;
(1) (since C++20)
constexpr explicit /*sentinel*/ ( Bound bound ) ;
(2) (since 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) (since C++20)
friend constexpr std:: iter_difference_t < W >

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

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

这些函数对普通的 非限定查找 限定查找 不可见,仅当 sentinel 是参数的关联类时才能通过 实参依赖查找 找到。

示例