Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/execution/when all"

From cppreference.com
< cpp‎ | execution
(move to cpp/experimental)
m (Reverted edits by Cooky (talk) to last revision by Space Mission)
Line 1: Line 1:
 +
{{cpp/execution/title|when_all}}
 +
{{cpp/experimental/execution/navbar}}
  
 +
{{ddcl|header=execution|since=c++26|
 +
execution::sender auto when_all(
 +
    execution::sender auto ...inputs
 +
);
 +
}}
 +
 +
===Parameters===
 +
{{par begin}}
 +
{{par|inputs|senders upon which the completion of {{tt|when_all}} is blocked. Can only include senders that can complete with a single set of values.}}
 +
{{par end}}
 +
 +
===Return value===
 +
Returns a sender that completes once all of the input senders have completed. The values sent by this sender are the values sent by each of the input senders, in order of the arguments passed to {{tt|when_all}}.
 +
 +
===Notes===
 +
* The sender returned by {{tt|when_all}} completes inline on the execution resource on which the last input sender completes, unless {{tt|stop}} is requested before {{tt|when_all}} is started, in which case it completes inline within the call to start.
 +
 +
===See also===
 +
{{dsc begin}}
 +
{{dsc inc|cpp/experimental/dsc when_all}}
 +
{{dsc end}}
 +
 +
{{langlinks|zh}}

Revision as of 13:07, 3 October 2024

Defined in header <execution>
execution::sender auto when_all(

    execution::sender auto ...inputs

);
(since C++26)

Contents

Parameters

inputs - senders upon which the completion of when_all is blocked. Can only include senders that can complete with a single set of values.

Return value

Returns a sender that completes once all of the input senders have completed. The values sent by this sender are the values sent by each of the input senders, in order of the arguments passed to when_all.

Notes

  • The sender returned by when_all completes inline on the execution resource on which the last input sender completes, unless stop is requested before when_all is started, in which case it completes inline within the call to start.

See also

(concurrency TS)
produces a future that becomes ready when all given futures or shared_futures are ready
(function template) [edit]