Namespaces
Variants

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

From cppreference.net
Ranges library
Range adaptors
constexpr auto end ( ) ;
(C++20以降)

drop_while_view の終端を表すセンチネルまたはイテレータを返します。

実質的に ranges:: end ( base_ ) を返します。ここで base_ は基盤となるビューです。

目次

翻訳内容: - 「Contents」→「目次」 - その他のC++関連用語(Parameters、Return value、Example、See also)は翻訳せずに保持 - HTMLタグ、属性、構造は完全に保持 - 番号や書式は変更なし

パラメータ

(なし)

戻り値

ビューの終端を表すセンチネルまたはイテレータ。

#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);
}

関連項目

先頭を指すイテレータを返す
(公開メンバ関数)