std::execution::then
From cppreference.com
| ヘッダ <execution> で定義 |
||
| execution::sender auto then( execution::sender auto input, std::invocable</*values-sent-by*/(input)...> function ); |
(C++26以降) | |
[編集] パラメータ
| input | - | 実行されると、function が実行される値を送信する sender |
| 関数 | - | input sender に連鎖された新しい sender によって呼び出される invoc可能オブジェクト |
[編集] 戻り値
input sender によって記述されたタスクグラフを記述する sender を返します。これには、input sender によって送信された値を引数として provided function を呼び出すノードが追加されています。
then は、返された sender が開始されるまで function の実行を開始しないことが保証されます。
[編集] 例
execution::then の使用例。
execution::sender auto input = get_input(); execution::sender auto snd = execution::then(input, [](auto... args) { std::print(args...); }); // snd describes the work described by pred // followed by printing all of the values sent by pred