std::execution::when_all(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ 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 of when_all is 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_all completes inline on the execution resource on which the last input sender completes β€” unless stop is requested before when_all is started. In that case, it completes inline within the call to start. 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 in start. πŸ’€βœ¨

🌈 See also 🌈

  • when_all (concurrency TS) β€” produces a future that becomes ready when all given futures or shared_futures are 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