Future type for coroutines returning a value of type T. More...
#include <corochain.hpp>
Public Member Functions | |
T | await_resume () |
template<typename Func> | |
auto | Apply (Func func) -> TFuture< decltype(func(std::declval< T >()))> |
Applies a function to the result of the coroutine. | |
TFuture< void > | Ignore () |
Awaits the coroutine and ignores its result. | |
![]() | |
TFutureBase (TPromise< T > &promise) | |
TFutureBase (TFutureBase &&other) | |
TFutureBase (const TFutureBase &)=delete | |
TFutureBase & | operator= (const TFutureBase &)=delete |
TFutureBase & | operator= (TFutureBase &&other) |
bool | await_ready () const |
bool | done () const |
std::coroutine_handle | raw () |
void | await_suspend (std::coroutine_handle<> caller) |
Additional Inherited Members | |
![]() | |
using | promise_type = TPromise<T> |
![]() | |
std::coroutine_handle< TPromise< T > > | Coro = nullptr |
Future type for coroutines returning a value of type T.
Provides mechanisms to await and retrieve the result of a coroutine.
T | The type of the result. |
|
inline |
Applies a function to the result of the coroutine.
The provided function is applied to the result, and the outcome is wrapped in a new future.
Func | The type of the function. |
func | The function to apply. |
|
inline |
Awaits the coroutine and ignores its result.
This is useful when the result is not needed.