D++ (DPP)
C++ Discord API Bot Library
dpp::detail::when_any Namespace Reference

Internal cogwheels for dpp::when_any. More...

Classes

struct  arg_helper_s
 Type trait helper to obtain the actual type that will be used by a when_any when a type is passed as a parameter. May specialize for certain types for specific behavior, e.g. for an event_router, store the awaitable directly. More...
 
struct  arg_helper_s< dpp::event_router_t< T > >
 
struct  empty
 Empty result from void-returning awaitable. More...
 

Typedefs

template<typename T >
using awaitable_type = typename arg_helper_s< T >::type
 Alias for the actual type that an awaitable will be stored as in a when_any. For example if given an event_router, store the awaitable, not the event_router. More...
 
template<typename T >
using arg_helper = arg_helper_s< std::remove_cvref_t< T > >
 Helper struct with a method to convert an awaitable parameter to the actual value it will be stored as. For example if given an event_router, store the awaitable, not the event_router. More...
 
template<typename T >
using storage_type = std::conditional_t< std::is_void_v< T >, empty, T >
 Actual type a result will be stores as in when_any. More...
 

Enumerations

enum  await_state { await_state::started, await_state::waiting, await_state::done, await_state::dangling }
 Current state of a when_any object. More...
 

Variables

template<typename T >
concept void_result = std::same_as<T, empty>
 Concept satisfied if a stored result is void. More...
 

Detailed Description

Internal cogwheels for dpp::when_any.

Typedef Documentation

◆ arg_helper

template<typename T >
using dpp::detail::when_any::arg_helper = typedef arg_helper_s<std::remove_cvref_t<T> >

Helper struct with a method to convert an awaitable parameter to the actual value it will be stored as. For example if given an event_router, store the awaitable, not the event_router.

◆ awaitable_type

template<typename T >
using dpp::detail::when_any::awaitable_type = typedef typename arg_helper_s<T>::type

Alias for the actual type that an awaitable will be stored as in a when_any. For example if given an event_router, store the awaitable, not the event_router.

◆ storage_type

template<typename T >
using dpp::detail::when_any::storage_type = typedef std::conditional_t<std::is_void_v<T>, empty, T>

Actual type a result will be stores as in when_any.

Enumeration Type Documentation

◆ await_state

Current state of a when_any object.

Enumerator
started 

Object was started but not awaited.

waiting 

Object is being awaited.

done 

Object was resumed.

dangling 

Object was destroyed.

Variable Documentation

◆ void_result

template<typename T >
concept dpp::detail::when_any::void_result = std::same_as<T, empty>

Concept satisfied if a stored result is void.

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