std::execution::then(3)
π NAME π
okay so this is the std::execution::then(3) page from the C++ Standard Libary β manual name folded in near the top, as requested bestie π
std::execution::then β std::execution::then β¨
β¨ Synopsis β¨
Defined in the header <execution> π«Ά
execution::sender auto then(
execution::sender auto input, (since C++26)
std::invocable<values-sent-by(input)...> function
);
πΈ Parameters πΈ
inputβ the sender that, once executed, sends the values thatfunctionruns on π¦functionβ the invocable that gets called by the new sender chained to theinputsender π
π Return value π
Returns a sender describing the task graph described by the input sender, with an added node that invokes the provided function with the values sent by the input sender as arguments β it's giving task-graph glow-up β¨
then is guaranteed to not begin executing function until the returned sender is started. No cap, that timing detail matters π
π Example π
Possible usage of execution::then β observed, iconic, here's the demo bestie:
execution::sender auto input = get_input();
execution::sender auto snd = execution::then(input, [](auto... args)
{
std::print(args...);
});
// snd describes the work described by pred
// followed by printing all of the values sent by pred
source/version/date sign-off, bestie π«Ά: cppreference.com Β· 2024.06.10 Β· std::execution::then(3) β byeee, go slay some senders ππ¦
π¦ 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