libcoro
1.0
Coroutine support library for C++20
|
Creates coroutine compatible memory layout, so the object acts as an coroutine. More...
#include <frame.h>
Public Member Functions | |
std::coroutine_handle | get_handle () |
Sets done flag. More... | |
template<typename Awt > | |
void | await (Awt &awt) |
Emulates co_await (without await_resume) More... | |
template<typename Awt > | |
bool | try_await (Awt &awt) |
Emulates co_await (without await_resume) with no suspend when ready. More... | |
Creates coroutine compatible memory layout, so the object acts as an coroutine.
Note this is experimental and undocumented feature. It is highly implemetation depended. Currently only GCC, CLANG and MSC are supported
T | class must defined two functions resume() and destroy(). The functions resume() and destroy() are mapped to coroutine_handle<>::resume() and coroutine_handle<>::destroy(). There is no specification, what these function must do. |
To retrieve handle of such "fake" coroutine, call get_handle()