std::generator<Ref,V,Allocator>::promise_type

From cppreference.com
< cpp‎ | coroutine‎ | generator
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
 
Ranges library
Range access
Range conversions
(C++23)

Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 
class generator<Ref, V, Allocator>::promise_type;
(since C++23)

The promise type of std::generator.

Data members

Member name Definition
value_ (private) A pointer of type std::add_pointer_t<std::generator::yielded> to the yielded value.
Default value is nullptr.
(exposition-only member object*)
except_ (private) A pointer of type std::exception_ptr to an exception object.
(exposition-only member object*)

Member functions

(constructor)
(implicitly declared)
constructs the promise_type object
(public member function)
(destructor)
(implicitly declared)
destroys the promise_type object
(public member function)
issues the generator object
(public member function)
issues an awaiter for initial suspend point
(public member function)
issues an awaiter for final suspend point
(public member function)
processes the object obtained from co_yield
(public member function)
await_transform
[deleted]
maps the object obtained from co_await to an awaiter
(public member function)
handles co_return; or the exit out of coroutine's body
(public member function)
processes exceptions that leaked from the coroutine's body
(public member function)
[static] (C++23)
allocates memory using Allocator
(public static member function)
[static] (C++23)
deallocates memory previously obtained from operator new
(public static member function)

Example

See also

used for coroutines with no observable effects
(class)