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

Implementation details for internal use only. More...

Namespaces

 async
 
 coroutine
 
 event_router
 Internal cogwheels for dpp::event_router_t.
 
 job
 
 std_coroutine
 Alias for either std or std::experimental depending on compiler and library.
 
 task
 
 when_any
 Internal cogwheels for dpp::when_any.
 

Classes

struct  empty_tag_t
 Empty struct used for overload resolution. More...
 

Typedefs

template<typename T >
using awaitable_result = decltype(co_await_resolve(std::declval< T >()).await_resume())
 Convenience alias for the result of a certain awaitable's await_resume. More...
 

Functions

decltype(auto) co_await_resolve (auto &&expr)
 Mimics the compiler's behavior of using co_await. More...
 

Variables

template<typename T >
bool has_await_members
 Concept to check if a type has useable await_ready(), await_suspend() and await_resume() member functions. More...
 
template<typename T >
bool has_co_await_member
 Concept to check if a type has a useable operator co_await() member. More...
 
template<typename T >
bool has_free_co_await
 Concept to check if a type has a useable overload of the free function operator co_await(expr) More...
 

Detailed Description

Implementation details for internal use only.

Attention
This is only meant to be used by D++ internally. Support will not be given regarding the facilities in this namespace.

Typedef Documentation

◆ awaitable_result

template<typename T >
using dpp::detail::awaitable_result = typedef decltype(co_await_resolve(std::declval<T>()).await_resume())

Convenience alias for the result of a certain awaitable's await_resume.

Function Documentation

◆ co_await_resolve()

decltype(auto) dpp::detail::co_await_resolve ( auto &&  expr)

Mimics the compiler's behavior of using co_await.

That is, it returns whichever works first, in order : expr.operator co_await(); > operator co_await(expr) > expr

This function is conditionally noexcept, if the returned expression also is.

Referenced by dpp::detail::task::promise_base::await_transform().

Here is the caller graph for this function:

Variable Documentation

◆ has_await_members

template<typename T >
bool dpp::detail::has_await_members

Concept to check if a type has useable await_ready(), await_suspend() and await_resume() member functions.

Note
This is actually a C++20 concept but Doxygen doesn't do well with them

◆ has_co_await_member

template<typename T >
bool dpp::detail::has_co_await_member

Concept to check if a type has a useable operator co_await() member.

Note
This is actually a C++20 concept but Doxygen doesn't do well with them

◆ has_free_co_await

template<typename T >
bool dpp::detail::has_free_co_await

Concept to check if a type has a useable overload of the free function operator co_await(expr)

Note
This is actually a C++20 concept but Doxygen doesn't do well with them