3 ms·
What it seems impossible? You can easily implement 0-overhead coroutines yourself with macros and the duff device. They are just cumbersome. Chris proposal was
by gpderetta 5y ago
What it seems impossible? You can easily implement 0-overhead coroutines yourself with macros and the duff device. They are just cumbersome.
Chris proposal was "just" syntactic sugar over that. He went so far as producing a working implementation on a clang branch. The most important difference to what was eventually standardized is that the coroutine object is a non type erased value type (basically very similar to a lambda, and in fact an extension on top of it). The big issue is that it was very hard to use safely as the address of local variables could potentially change between invocations if the coroutine is copied around.