命名空间
变体
操作

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

来自 cppreference.cn
< cpp‎ | ranges‎ | iota view
 
 
范围库
范围适配器
 
 
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是参数的关联类时通过实参依赖查找找到。

[编辑] 示例