|
uvco 0.1
|
#include <promise.h>

Classes | |
| struct | PromiseAwaiter_ |
| Handles the actual suspension and resumption. More... | |
Public Types | |
| using | promise_type = Coroutine<void> |
Public Member Functions | |
| Promise (Promise< void > &&other) noexcept | |
| Promise ready to be awaited or fulfilled. | |
| Promise & | operator= (const Promise< void > &other)=delete |
| Promise & | operator= (Promise< void > &&other) noexcept |
| Promise (const Promise< void > &other)=delete | |
| ~Promise () | |
| PromiseAwaiter_ | operator co_await () const |
| bool | ready () const |
| Returns whether the promise has already been fulfilled. | |
| void | unwrap () |
Private Types | |
| using | PromiseCore_ = PromiseCore<void> |
Private Member Functions | |
| Promise (PromiseCore_ &core) | |
| PromiseCore< void > * | core () |
Private Attributes | |
| PromiseCore< void > * | core_ |
Friends | |
| class | Coroutine< void > |
| template<typename... Ts> | |
| class | SelectSet |
| class | Coroutine |
A void promise works slightly differently than a Promise<T> in that it doesn't return a value. However, aside from return_void() being implemented instead of return_value(), the mechanics are identical.
NOTE: for a transition period, Promise<void> is more efficient than Promise<T>: it does not allocate a separate PromiseCore. Instead, the PromiseCore<void> is placed in the Coroutine<void> frame, which itself is allocated anyway.
| using uvco::Promise< void >::promise_type = Coroutine<void> |
Part of the coroutine protocol: Promise<void> is both return type and promise type.
|
private |
|
noexcept |
Promise ready to be awaited or fulfilled.
|
delete |
| uvco::Promise< void >::~Promise | ( | ) |
|
explicitprivate |
|
inlineprivate |
| Promise< void >::PromiseAwaiter_ uvco::Promise< void >::operator co_await | ( | ) | const |
Returns an awaiter object for the promise, handling actual suspension and resumption.
|
delete |
|
noexcept |
|
nodiscard |
Returns whether the promise has already been fulfilled.
| void uvco::Promise< void >::unwrap | ( | ) |
|
friend |
|
friend |
|
friend |
|
private |