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

来自cppreference.com
< cpp‎ | ranges‎ | iota view
 
 
范围库
范围适配器
 
 
struct /*sentinel*/;
(仅用于阐述*)

ranges::iota_view<W, Bound>::iteratorranges::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 为实参的关联类时由实参依赖查找找到。

示例