Namespaces
Variants
Actions

std::coroutine_traits

From cppreference.com
< cpp‎ | coroutine
 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Coroutine support
Coroutine traits
coroutine_traits
(C++20)
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
 
Defined in header <coroutine>
template< class R, class... Args >
struct coroutine_traits;
(since C++20)

Determines the promise type from the return type and parameter types of a coroutine. The standard library implementation provides a publicly accessible member type promise_type same as R::promise_type if the qualified-id is valid and denotes a type. Otherwise, it has no such member.

Program-defined specializations of coroutine_traits must define a publicly accessible nested type promise_type, otherwise the program is ill-formed.

Contents