3 ms·
I wouldn't call it straightforward, boost.coroutine requires custom assembler for its implementation. Then again, stackfull coroutines are significantly more po
by gpderetta 10y ago
I wouldn't call it straightforward, boost.coroutine requires custom assembler for its implementation. Then again, stackfull coroutines are significantly more powerful than generators available in most other programming languages (notable recent exceptions are Go and Lua).
Boost.asio provides stackless generators [1] implemented purely in C++, by (ab)using the preprocessor and the switch statement.
[1] http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio/overview/core/coroutine.html http://www.boost.org/doc/libs/1_62_0/doc/html/boost_asio/ove...