std::execution:: then
From cppreference.net
C++
Execution control library
|
定義済みヘッダー
<execution>
|
||
|
execution
::
sender
auto
then
(
execution
::
sender
auto
input,
std:: invocable < /*values-sent-by*/ ( input ) ... > function ) ; |
(C++26以降) | |
パラメータ
| input | - | 関数が実行される値を送信する、一度実行されたsender |
| function | - | 入力senderにチェーンされた新しいsenderによって呼び出される呼び出し可能オブジェクト |
戻り値
入力センダーによって送信された値を引数として提供された関数を呼び出すノードを追加した、入力センダーによって記述されるタスクグラフを記述するセンダーを返します。
then
は、返されたsenderが開始されるまで関数の実行を開始しないことが保証されています。
例
execution::then
の使用可能性。
execution::sender auto input = get_input(); execution::sender auto snd = execution::then(input, [](auto... args) { std::print(args...); }); // sndはpredによって記述された作業と // predによって送信されたすべての値の出力を記述する