Namespaces
Variants

std::ranges::take_while_view<V,Pred>::pred

ja.cppreference.net より
 
 
範囲ライブラリ
範囲アダプタ
 
 
constexpr const Pred& pred() const;
(C++20 以降)

格納されている述語への参照を返します pred_。

もし *this が述語を保持していない場合 (例えば、*this への代入時、つまり Pred のコピー構築またはムーブ構築時に例外が送出された場合など)、動作は未定義です。

パラメータ

(なし)

戻り値

格納された述語への参照。

例

#include <ranges>
int main()
{
    static constexpr int a[]{1, 2, 3, 4, 5};
    constexpr auto v = a | std::views::take_while([](int x){ return x < 4; });
    const auto pred = v.pred();
    static_assert(pred(3));
}

関連項目

基になる(アダプトされた)ビューのコピーを返す
(公開メンバ関数)