libcoro  1.0
Coroutine support library for C++20
Public Member Functions | List of all members
coro::frame< T > Class Template Reference

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...
 

Detailed Description

template<typename T>
class coro::frame< T >

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

Template Parameters
Tclass 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()

Definition at line 30 of file frame.h.


The documentation for this class was generated from the following file: