D++ (DPP)  10.0.30
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. More...
 
struct  arg_helper_s< dpp::event_router_t< T > >
 
struct  empty
 Empty result from void-returning awaitable. More...
 

Typedefs

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. More...
 
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. 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.