std::genera...romise_type(3)
π NAME
std::generator::promise_type β bestie, this is literally std::generator::promise_type, the promise type situation for std::generator πΈ (yes, the C++ Standard Library page, we're in the big leagues now)
This page lives in the C++ Standard Library section of the cppreference man pages β ok so now you know where you are, let's go β¨
β¨ SYNOPSIS β¨
class generator<Ref, V, Allocator>::promise_type; (since C++23)
That's it, that's the declaration π since C++23 β so if you're on an older standard, she is not here for you yet, no cap.
The promise type of std::generator. Like, that's her whole job description π
π MEMBER FUNCTIONS π
Ok bestie this is the part you actually came for, the whole roster, everybody's here, nobody gets left out π«Ά
- constructor β constructs the
promise_typeobject, and note that she's (implicitly declared) and a (public member function) π - destructor β destroys the
promise_typeobject, also (implicitly declared), also (public member function) π get_return_objectβ issues the generator object (public member function) πinitial_suspendβ issues an awaiter for initial suspend point (public member function) βfinal_suspendβ issues an awaiter for final suspend point (public member function) π₯yield_valueβ processes the object obtained fromco_yield(public member function) πawait_transformβ maps the object obtained fromco_awaitto an awaiter β and heads up, this one is marked[deleted](public member function) π iykyk, she's not availablereturn_voidβ handlesco_return; or the exit out of coroutine's body (public member function) πunhandled_exceptionβ processes exceptions that leaked from the coroutine's body (public member function) πoperator newβ allocates memory usingAllocator, marked[static]and(C++23)(public static member function) β¨operator deleteβ deallocates memory previously obtained fromoperator new, marked[static]and(C++23)(public static member function) π§
π¦ EXAMPLE π¦
Ok so bestie, I have to be honest with you about this one:
This section is incomplete Reason: no example
Yeah. No example. It's giving "the assignment is due and the doc is empty" π literally nothing to show you here, moving on π
π SEE ALSO π
noop_coroutine_promiseβ used for coroutines with no observable effects (C++20) (class) πΈ β the lowkey chill one with nothing to prove
π CATEGORY
- Todo no example
Like, the todo is literally "no example". We been knew π
little sign-off bc you deserve it π β this beauty comes to you straight from http://cppreference.com, dated 2024.06.10. Slay, go write a generator, and remember: keep every co_await in check and every co_yield cute πβ¨π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms