命名空间
变体
操作

std::ranges::split_view<V,Pattern>::sentinel

来自 cppreference.cn
< cpp‎ | ranges‎ | split view
 
 
范围库
范围适配器
 
 
class /*sentinel*/;
(自 C++20 起)
(仅为阐释目的*)

当底层 view 类型 Vmodel common_range 时,split_view::end 的返回类型。

内容

[编辑] 数据成员

成员 描述
ranges::sentinel_t<V> end_ (private) 底层 view 的 sentinel
(仅为阐释目的成员对象*)

[编辑] 成员函数

(构造函数)
(C++20)
构造 sentinel
(公有成员函数)

std::ranges::split_view::sentinel::sentinel

/*sentinel*/() = default;
(1) (自 C++20 起)
constexpr explicit /*sentinel*/( ranges::split_view& parent );
(2) (自 C++20 起)
1) 通过其默认成员初始化器(= ranges::sentinel_t<V>())对 end_ 进行值初始化。
2) 使用 ranges::end(parent.base_) 初始化 end_

[编辑] 非成员函数

operator==
(C++20)
比较底层迭代器和底层 sentinel
(函数)

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

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

等价于 return x.cur_ == y.end_ and !x.trailing_empty_;

!= 运算符从 operator== 合成

此函数对于普通的非限定限定查找是不可见的,并且只能通过实参依赖查找std::ranges::split_view::sentinel 是参数的关联类时找到。