std::ranges::take_while_view<V,Pred>:: pred
From cppreference.net
<
cpp
|
ranges
|
take while view
C++
Ranges library
|
||||||||||||||||||||||
| Range primitives | |||||||
|
|||||||
| Range concepts | |||||||||||||||||||
|
|||||||||||||||||||
| Range factories | |||||||||
|
|||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||
| Helper items | |||||||||||||||||
|
|
||||||||||||||||
|
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)); }
関連項目
|
基になる(アダプトされた)ビューのコピーを返す
(公開メンバ関数) |