std::ranges::filter_view<V,Pred>::sentinel
来自 cppreference.cn
< cpp | ranges | filter view
class /*sentinel*/; |
(since C++20) (仅为演示用途*) |
|
filter_view::end 的返回类型,当底层 view
V
不符合 common_range
模型时。
内容 |
[编辑] 数据成员
成员 | 定义 |
V end_ (private) |
底层 view 的哨位(仅为演示用途的成员对象*) |
[编辑] 成员函数
构造一个哨位 (公共成员函数) | |
返回底层哨位 (公共成员函数) |
std::ranges::filter_view::sentinel::sentinel
/*sentinel*/() = default; |
(1) | (since C++20) |
constexpr explicit /*sentinel*/( filter_view& parent ); |
(2) | (since C++20) |
std::ranges::filter_view::sentinel::base
constexpr ranges::sentinel_t<V> base() const; |
(since C++20) | |
等价于 return end_;。
[编辑] 非成员函数
(C++20) |
比较底层迭代器和底层哨位 (函数) |
operator==(std::ranges::filter_view::iterator, std::ranges::filter_view::sentinel)
friend constexpr bool operator==( const /*iterator*/& x, const /*sentinel*/& y ); |
(since C++20) | |
等价于 return x.current_ == y.end_;,其中 current_
是包装在 filter_view::iterator
中的底层迭代器。
!=
运算符从 operator==
合成。
此函数对于普通的非限定或限定查找是不可见的,并且只能在 std::ranges::filter_view::sentinel
是参数的关联类时,通过实参依赖查找找到。