std::execut...pon_stopped(3)

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

okay bestie, welcome to std::execut...pon_stopped(3) β€” that’s the manual page straight from the C++ Standard Libary (yes, β€œLibary,” that’s literally how it’s spelled in the header, iykyk πŸ’…). this one is all about the std::execution::upon_stopped sender adaptor, and it is lowkey iconic ✨.

πŸ’– NAME πŸ’–

std::execution::upon_stopped - std::execution::upon_stopped

like, the name is the name, periodt πŸŽ€. this is the page for std::execution::upon_stopped.


πŸ¦‹ Synopsis πŸ¦‹

okay so here’s the whole synopsis vibe, copied exactly because we do not play with code 🫢:

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

    execution::sender auto input,     (since C++26)
    std::invocable auto function

);

and yes, it says (since C++26) right there in the code β€” this is a C++26-era thing, no cap ⭐.

🌸 Parameters 🌸

  • input β€” the sender which, once it gets a β€œstop token,” will notify the new node to execute the function πŸ’Œ
  • function β€” the invocable to be called in case a β€œstopped” signal is sent to the input sender πŸ”₯

πŸ‘‘ Return value πŸ‘‘

Returns a sender describing the task graph described by the input sender, with an added node of invoking the provided function in case the β€œstopped” signal is sent to the input sender πŸ’«.

that’s the whole return-value situation, bestie: same task graph energy, plus one new node for the stopped-signal case 🧚.


shoutout to http://cppreference.com, dated 2024.06.10, and tagged std::execut...pon_stopped(3) β€” bye bestie, slay your sender adaptors responsibly πŸ’–πŸŽ€

πŸ“¦ where this page comes from