dpp::detail::task::promise_t< void >
dpp::detail::task::promise_base< void >
dpp::detail::task::promise_base< void >
task.h
struct friend struct final_awaiter< void > final_awaiter< R > dpp::detail::task::promise_t< void >::final_awaiter< R > final_awaiter< R >
struct friend struct final_awaiter< void > final_awaiter< void > dpp::detail::task::promise_t< void >::final_awaiter< void > final_awaiter< void >
auto auto dpp::detail::task::promise_base< void >::await_transform (T &&expr) const await_transform dpp::detail::task::promise_t< void >::await_transform T && expr

Function called whenever co_await is used inside of the task.

dpp::task_cancelled_exception

On resumption if the task was cancelled

proxy_awaiter Returns a proxy awaiter that will check for cancellation on resumption

void void dpp::basic_promise< void >::emplace_value (Args &&... args) emplace_value dpp::detail::task::promise_t< void >::emplace_value Args &&... args

Construct the result in place by forwarding the arguments, and by default resume any awaiter.

Notify

Whether to resume any awaiter or not.

dpp::logic_exception

if the promise is not empty.

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

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

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

awaitable< void > awaitable< void > dpp::detail::promise::promise_base< void >::get_awaitable () get_awaitable dpp::detail::task::promise_t< void >::get_awaitable

Get an awaitable object for this promise.

dpp::logic_exception

if get_awaitable has already been called on this object.

awaitable<T> An object that can be co_await-ed to retrieve the value of this promise.

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

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

task The coroutine object

std_coroutine::suspend_never std_coroutine::suspend_never dpp::detail::task::promise_base< void >::initial_suspend () const noexcept initial_suspend dpp::detail::task::promise_t< void >::initial_suspend

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

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

void void dpp::detail::promise::promise_base< void >::notify_awaiter () notify_awaiter dpp::detail::task::promise_t< void >::notify_awaiter

Notify a currently awaiting coroutine that the result is ready.

This may resume the coroutine on the current thread.

?

Any exception thrown by the coroutine if resumed will propagate

void void dpp::detail::task::promise_t< void >::return_value (void &&expr) return_value dpp::detail::task::promise_t< void >::return_value void && expr

Function called by the standard library when the coroutine co_returns a value.

Stores the value internally to hand to the caller when it resumes.

expr

The value given to co_return

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

Function called by the standard library when the coroutine co_returns.

Sets the promise state to finished.

void void dpp::detail::promise::promise_base< void >::set_exception (std::exception_ptr ptr) set_exception dpp::detail::task::promise_t< void >::set_exception std::exception_ptr ptr

Set this promise to an exception and resume any awaiter.

Notify

Whether to resume any awaiter or not.

dpp::logic_exception

if the promise is not empty.

?

Any exception thrown by the coroutine if resumed will propagate

void void dpp::basic_promise< void >::set_value (U &&v) set_value dpp::detail::task::promise_t< void >::set_value U && v

Construct the result by forwarding reference, and resume any awaiter.

Notify

Whether to resume any awaiter or not.

dpp::logic_exception

if the promise is not empty.

void void dpp::detail::task::promise_base< void >::unhandled_exception () unhandled_exception dpp::detail::task::promise_t< void >::unhandled_exception

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 > std::atomic<bool> dpp::detail::task::promise_base< void >::cancelled cancelled dpp::detail::task::promise_t< void >::cancelled

Whether the task is cancelled or not.

result_t< void > using dpp::detail::promise::promise_base< void >::storage_type = storage_type dpp::detail::task::promise_t< void >::storage_type

Variant representing one of either 3 states of the result value : empty, result, exception.

std_coroutine::coroutine_handle std_coroutine::coroutine_handle dpp::detail::promise::promise_base< void >::awaiter awaiter dpp::detail::task::promise_t< void >::awaiter

Coroutine handle currently awaiting the completion of this promise.

std::atomic< uint8_t > std::atomic<uint8_t> dpp::detail::promise::promise_base< void >::state state dpp::detail::task::promise_t< void >::state

State of the awaitable tied to this promise.

storage_type storage_type dpp::detail::promise::promise_base< void >::value value dpp::detail::task::promise_t< void >::value

State of the result value.

storage_type

use .index() instead of std::holds_alternative to support promise_base<std::exception_ptr> and promise_base<std::monostate> :)

std_coroutine::coroutine_handle std_coroutine::coroutine_handle dpp::detail::promise::promise_base< void >::release_awaiter () release_awaiter dpp::detail::task::promise_t< void >::release_awaiter

Unlinks this promise from its currently linked awaiter and returns it.

At the time of writing this is only used in the case of a serious internal error in dpp::task. Avoid using this as this will crash if the promise is used after this.

void void dpp::detail::promise::promise_base< void >::throw_if_not_empty () throw_if_not_empty dpp::detail::task::promise_t< void >::throw_if_not_empty

Check if the result is empty, throws otherwise.

dpp::logic_exception

if the result isn't empty.

Implementation of task::promise_t for void return type.

dpp::basic_promise< T >
dpp::basic_promise< R >
< R >
dpp::basic_promise< void >
< void >
dpp::detail::promise::promise_base< T >
dpp::detail::promise::promise_base< R >
< R >
dpp::detail::promise::promise_base< T >
dpp::detail::promise::promise_base< void >
< void >
dpp::detail::task::promise_base< R >
dpp::detail::task::promise_base< R >
dpp::detail::task::promise_base< void >
< void >
dpp::detail::task::promise_t< R >
dpp::detail::task::promise_t< void >
< void >
T
bool
dpp::basic_promise< T >
dpp::basic_promise< R >
< R >
dpp::basic_promise< void >
< void >
dpp::detail::promise::promise_base< T >
value
state
awaiter
dpp::detail::promise::promise_base< R >
value
state
awaiter
< R >
dpp::detail::promise::promise_base< T >
value
state
awaiter
dpp::detail::promise::promise_base< void >
value
state
awaiter
< void >
dpp::detail::task::promise_base< R >
cancelled
dpp::detail::task::promise_base< R >
cancelled
dpp::detail::task::promise_base< void >
cancelled
< void >
dpp::detail::task::promise_t< R >
dpp::detail::task::promise_t< void >
< void >
result_t< R >
result_t< T >
result_t< void >
std::atomic< T >
ptr
std::atomic< bool >
ptr
< bool >
std::atomic< uint8_t >
ptr
< uint8_t >
coroutine_handle
uint8_t
- dpp::detail::task::promise_t< void >
  await_transform
- dpp::detail::task::promise_t< void >
  awaiter
- dpp::detail::task::promise_t< void >
  cancelled
- dpp::detail::task::promise_t< void >
  emplace_value
- dpp::detail::task::promise_t< void >
  final_awaiter< R >
- dpp::detail::task::promise_t< void >
  final_awaiter< void >
- dpp::detail::task::promise_t< void >
  final_suspend
- dpp::detail::task::promise_t< void >
  get_awaitable
- dpp::detail::task::promise_t< void >
  get_return_object
- dpp::detail::task::promise_t< void >
  initial_suspend
- dpp::detail::task::promise_t< void >
  notify_awaiter
- dpp::detail::task::promise_t< void >
  operator=
- dpp::detail::task::promise_t< void >
  promise_base
- dpp::detail::task::promise_t< void >
  release_awaiter
- dpp::detail::task::promise_t< void >
  return_value
- dpp::detail::task::promise_t< void >
  return_void
- dpp::detail::task::promise_t< void >
  set_exception
- dpp::detail::task::promise_t< void >
  set_value
- dpp::detail::task::promise_t< void >
  state
- dpp::detail::task::promise_t< void >
  storage_type
- dpp::detail::task::promise_t< void >
  throw_if_not_empty
- dpp::detail::task::promise_t< void >
  unhandled_exception
- dpp::detail::task::promise_t< void >
  value