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.
I’m excited to actually getting around to trying coroutines - they should be a good replacement for simple state machines. Rather than an storing an object with a state enum, I can write simple declarative code.
Random switching between "Awaitor" and "awaiter" makes it seem like these are distinct concepts instead that the reader is supposed to understand.
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.
I recently decided that it was time to properly learn C++ coroutines. I looked at a few tutorials, but by far the best was Raymond Chen coroutine series[1]. It is a long series, but every article is just the right size. Strongly recommended.
5 comments
[ 3.1 ms ] story [ 29.1 ms ] threadThis 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...
[2] http://wg21.link/P2079R5
[3] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p31...
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.
[1] https://devblogs.microsoft.com/oldnewthing/20210504-01/?p=10...