D++ (DPP)
C++ Discord API Bot Library
|
Base implementation of task::promise_t, without the logic that would depend on the return type. Meant to be inherited from. More...
Classes | |
struct | proxy_awaiter |
Proxy awaitable that wraps any co_await inside the task and checks for cancellation on resumption. More... | |
Public Member Functions | |
std_coroutine::suspend_never | initial_suspend () const noexcept |
Function called by the standard library when the coroutine is created. More... | |
void | unhandled_exception () |
Function called by the standard library when an exception is thrown and not caught in the coroutine. More... | |
template<typename T > | |
auto | await_transform (T &&expr) const noexcept(noexcept(co_await_resolve(std::forward< T >(expr)))) |
Function called whenever co_await is used inside of the task. More... | |
Public Attributes | |
std::atomic< bool > | cancelled = false |
Whether the task is cancelled or not. More... | |
Base implementation of task::promise_t, without the logic that would depend on the return type. Meant to be inherited from.
|
inlinenoexcept |
Function called whenever co_await is used inside of the task.
dpp::task_cancelled_exception | On resumption if the task was cancelled |
|
inlinenoexcept |
Function called by the standard library when the coroutine is created.
|
inline |
Function called by the standard library when an exception is thrown and not caught in the coroutine.
Stores the exception pointer to rethrow on co_await. If the task object is destroyed and was not cancelled, throw instead
std::atomic<bool> dpp::detail::task::promise_base< R >::cancelled = false |
Whether the task is cancelled or not.