D++ (DPP)
C++ Discord API Bot Library
dpp::detail::task::promise_t< void > Struct Reference

Implementation of task::promise_t for void return type. More...

+ Inheritance diagram for dpp::detail::task::promise_t< void >:
+ Collaboration diagram for dpp::detail::task::promise_t< void >:

Public Member Functions

void return_void () noexcept
 Function called by the standard library when the coroutine co_returns. More...
 
dpp::task< void > get_return_object () noexcept
 Function called by the standard library when the coroutine is created. More...
 
final_awaiter< void > final_suspend () const noexcept
 Function called by the standard library when the coroutine reaches its last suspension point. More...
 
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...
 
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< boolcancelled
 Whether the task is cancelled or not. More...
 

Friends

struct final_awaiter< void >
 

Detailed Description

Implementation of task::promise_t for void return type.

Member Function Documentation

◆ await_transform()

auto dpp::detail::task::promise_base< void >::await_transform ( T &&  expr) const
inlinenoexceptinherited

Function called whenever co_await is used inside of the task.

Exceptions
dpp::task_cancelled_exceptionOn resumption if the task was cancelled
Returns
proxy_awaiter Returns a proxy awaiter that will check for cancellation on resumption

◆ final_suspend()

final_awaiter<void> dpp::detail::task::promise_t< void >::final_suspend ( ) const
inlinenoexcept

Function called by the standard library when the coroutine reaches its last suspension point.

Returns
final_awaiter Special object containing the chain resolution and clean-up logic.

◆ get_return_object()

dpp::task<void> dpp::detail::task::promise_t< void >::get_return_object ( )
inlinenoexcept

Function called by the standard library when the coroutine is created.

Returns
task The coroutine object

◆ initial_suspend()

std_coroutine::suspend_never dpp::detail::task::promise_base< void >::initial_suspend
inlinenoexceptinherited

Function called by the standard library when the coroutine is created.

Returns
std::suspend_never Don't suspend, the coroutine starts immediately.

◆ return_void()

void dpp::detail::task::promise_t< void >::return_void ( )
inlinenoexcept

Function called by the standard library when the coroutine co_returns.

Does nothing but is required by the standard library.

◆ unhandled_exception()

void dpp::detail::task::promise_base< void >::unhandled_exception
inlineinherited

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

Friends And Related Function Documentation

◆ final_awaiter< void >

friend struct final_awaiter< void >
friend

Member Data Documentation

◆ cancelled

std::atomic<bool> dpp::detail::task::promise_base< void >::cancelled
inherited

Whether the task is cancelled or not.

D++ Library version 9.0.13D++ Library version 9.0.12D++ Library version 9.0.11D++ Library version 9.0.10D++ Library version 9.0.9D++ Library version 9.0.8D++ Library version 9.0.7D++ Library version 9.0.6D++ Library version 9.0.5D++ Library version 9.0.4D++ Library version 9.0.3D++ Library version 9.0.2D++ Library version 9.0.1D++ Library version 9.0.0D++ Library version 1.0.2D++ Library version 1.0.1D++ Library version 1.0.0