4 ms·
The unreliable allocation elision is very relevant for most coroutine users. edit: also the lack of composability is relevant.
by gpderetta 5y ago
The unreliable allocation elision is very relevant for most coroutine users.
edit: also the lack of composability is relevant.
- gsliepen 5y agoIt is possible to compose them more easily than described in the article; Lewis Baker's cppcoro library for example provides a recursive_generator<> type[0] that allows this without using any macros. It's up to the library part of coroutines to make things easy, end users are not expected to write low-level coroutine code themselves. I wonder about the allocation elision. Return value optimization became mandatory, and some compilers can already elide calls to new/delete and malloc()/free() in normal code, so perhaps it will be possible to guarantee allocation elision in the future in the most used cases. [0]: https://github.com/lewissbaker/cppcoro#recursive_generatort https://github.com/lewissbaker/cppcoro#recursive_generatort