std::execution::when_all(3)
β¨ NAME β¨
Okay so this is the std::execution::when_all(3) page from the C++ Standard Libary manual, and the NAME section literally says std::execution::when_all - std::execution::when_all. Yes bestie, it said the name twice with a dash, and we are not arguing with that main character energy. π
The whole page is about std::execution::when_all, the function that takes senders and returns a sender that waits for all of them. No cap, it's giving coordinated group-chat completion vibes. π«Άβ¨
πΈ Synopsis πΈ
Defined in header <execution> β write it down, bestie, it's giving header inclusion realness. π The signature is exactly this:
execution::sender auto when_all(
execution::sender auto ...inputs (since C++26)
);
π Parameters π
inputsβ senders upon which the completion ofwhen_allis blocked. The rule is strict, bestie: this can only include senders that can complete with a single set of values. Single set only, no multi-value-set chaos. π«Ά
π 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. It's giving "everyone finishes, then we line up the values in argument order" realness. πβ¨
π¦ Notes π¦
- The sender returned by
when_allcompletes inline on the execution resource on which the last input sender completes β unless stop is requested beforewhen_allis started. In that case, it completes inline within the call tostart. That's the whole plot twist, bestie: last sender's execution resource gets the inline completion, unless stop shows up early and then it's inline instart. πβ¨
π See also π
when_all(concurrency TS) β produces a future that becomes ready when all given futures orshared_futuresare ready (function template). Same name, different context, still iconic. π«
Source/version/date check, bestie: http://cppreference.com Β· 2024.06.10 Β· std::execution::when_all(3). Mwah, bye! ππβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms