libcoro
1.0
Coroutine support library for C++20
|
COROUTINE: Coroutine for asynchronous operation. More...
#include <async.h>
Public Member Functions | |
async ()=default | |
construct uninitialized object More... | |
template<typename A > | |
async (async< T, A > &&other) | |
convert from different allocator (because the allocator is only used during creation) More... | |
void | detach () |
Run coroutine detached. More... | |
std::coroutine_handle | detach_on_await_suspend () |
detach coroutine using symmetric transfer More... | |
future< T > | start () |
Start coroutine and return future. More... | |
void | start (promise< T > prom) |
Start coroutine and pass return value to promise. More... | |
deferred_future< T > | defer_start () |
Defer start of coroutine. More... | |
shared_future< T > | shared_start () |
Start coroutine and return shared future. More... | |
future< T > | operator co_await () |
direct co_await More... | |
operator future< T > () | |
convert coroutine to future, start immediatelly More... | |
operator deferred_future< T > () | |
convert to deferred_future More... | |
operator shared_future< T > () | |
convert to shared_future More... | |
template<std::constructible_from< T > U> | |
operator U () | |
synchronous wait for value More... | |
auto | run () |
run synchronously More... | |
COROUTINE: Coroutine for asynchronous operation.
This represents a coroutine which can return a value. The object returned by the coroutine can be converted to future<T> or deferred_future<T>, or can be directly co_awaited. You can also convert this object to T to retrieve value synchronously
Synchronous access
Retrieve future
Direct co_await
T | type of returned value |
Alloc | optional allocator |