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/p35...
[3] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p31...
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.
In general this moves way too fast for the density of the grammar it's trying to introduce, lines like:
> We have seen Awaitors already - suspend_always is an empty awaiter type that has await_ready returns false always.
But we haven't "seen" suspend_always, it's mentioned in half a sentence in an earlier paragraph, with no further context or examples.
There's a reason Lewis Baker's writings about C++ coroutines are 5000 word monsters, the body of grammar which needs to be covered demands that level of careful and precise definition and exploration.
FWIW, I think a useful addition would be for compilers to output the intermediate source code, so you can reason more easily about behaviour and debug into readable code.
[1] https://devblogs.microsoft.com/oldnewthing/20210504-01/?p=10...
mog_dev•7h ago
uvdn7•5h ago
valorzard•4h ago