命名空间
变体
操作

std::ranges::drop_while_view<V,Pred>::end

来自 cppreference.cn
 
 
范围库 (Ranges library)
范围适配器 (Range adaptors)
 
 
constexpr auto end();
(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);
}

[编辑] 参阅

返回指向起始的迭代器
(公共成员函数) [编辑]