| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::detail::promise Namespace Reference

## Classes

struct | empty
| Empty result from void-returning awaitable. More...
class | promise_base
| Base class defining logic common to all promise types, aka the "write" end of an awaitable. More...

## Typedefs

template<typename T>
using | result_t = std::variant<std::monostate, std::conditional_t<std::is_void_v<T>, empty, T>, std::exception_ptr>
| Variant for the 3 conceptual values of a coroutine:

## Enumerations

enum | state_flags { sf_none = 0b0000000 , sf_has_awaitable = 0b00000001 , sf_awaited = 0b00000010 , sf_ready = 0b00000100 , sf_done = 0b00001000 , sf_broken = 0b0010000 }
| State of a promise. More...

## Functions

template<typename T>
void | spawn_sync_wait_job (auto *awaitable, std::condition_variable &cv, auto &&result)

## Typedef Documentation

## ◆ result_t

template<typename T>

using dpp::detail::promise::result_t = std::variant<std::monostate, std::conditional_t<std::is_void_v<T>, empty, T>, std::exception_ptr>

Variant for the 3 conceptual values of a coroutine:

## Enumeration Type Documentation

## ◆ state_flags

enum dpp::detail::promise::state_flags

State of a promise.

Enumerator
sf_none | Promise is empty.
sf_has_awaitable | Promise has spawned an awaitable.
sf_awaited | Promise is being awaited.
sf_ready | Promise has a result.
sf_done | Promise has completed, no more results are expected.
sf_broken | Promise was broken - future or promise is gone.

## Function Documentation

## ◆ spawn_sync_wait_job()

template<typename T>

void dpp::detail::promise::spawn_sync_wait_job | ( | auto * | awaitable,
|  | std::condition_variable & | cv,
|  | auto && | result )

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