3 ms·
Note that with std::execution, c++26 will have a default async runtime (similar to how C# has a default async runtime). This means that c++26 is getting a defa
by valorzard 1y ago
Note that with std::execution, c++26 will have a default async runtime (similar to how C# has a default async runtime).
This means that c++26 is getting a default coroutine task type [1] AND a default executor [2]. You can even spawn the tasks like in Tokio/async Rust. [3]
I’m not totally sure if this is a GOOD idea to add to the c++ standard but oh well.
[1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r2.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p35...
[2] http://wg21.link/P2079R5 http://wg21.link/P2079R5
[3] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r10.html https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p31...
- uvdn7 1y ago> I’m not totally sure if this is a GOOD idea to add to the c++ standard What are the downsides? Naively, it seems like a good idea to both provide a coroutine spec (for power users) and a default task type & default executor.
- valorzard 1y agowell, Rust didn't do the same thing for a reason. Rust lets you pick and choose what async runtime to use (even though everyone has decided to use Tokio anyways). This is good because it allows for alternative async runtimes like Embassy (https://embassy.dev/ https://embassy.dev/) and it also doesn't freeze the API into something that can't change. It could totally be possible that people find a new style of async that works better than std::execution.
- Rohansi 1y agoI don't know how it works for C++ but you're not locked down to a single implementation with how C# does it. You can have it use different executors/schedulers, different task types, etc.
- uvdn7 1y agoYou are also not locked down in C++. There are already a handful of coroutine and async runtime implementations out there.