名稱空間
變體
操作

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

來自 cppreference.com
 
 
範圍庫 (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);
}

[編輯] 參閱

返回指向起始的迭代器
(公共成員函式) [編輯]