std::ranges::drop_while_view<V,Pred>::end
来自 cppreference.cn
< cpp | ranges | drop while view
constexpr auto end(); |
(since C++20) | |
返回一个哨位或迭代器,表示 drop_while_view
的末尾。
实际上返回 ranges::end(base_),其中 base_
是底层视图。
目录 |
[编辑] 参数
(无)
[编辑] 返回值
一个哨位或迭代器,表示视图的末尾。
[编辑] 示例
运行此代码
#include <cassert> #include <iostream> #include <ranges> int main() { static constexpr auto data = {0, -1, -2, 3, 1, 4, 1, 5}; auto view = std::ranges::drop_while_view{data, [](int x) { return x <= 0; }}; assert(view.end()[-1] == 5); }
[编辑] 参见
返回指向开头的迭代器 (公共成员函数) |