2 ms·
Would you mind giving me the TLDR on no overhead? Seems impossible to me
by tomcam 5y ago
Would you mind giving me the TLDR on no overhead? Seems impossible to me
- gpderetta 5y agoWhat 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.