std::corout...from_promise(3)
π¦ std::corout...from_promise(3) π¦
okay bestie, welcome to the C++ Standard Libary manual β yes, thatβs literally the manual name, spelling and all, and this page is all about one very specific little coroutine-handle maker. π«Ά
π NAME π
std::coroutine_handle::from_promiseβstd::coroutine_handle::from_promise
yeah, the NAME line says it twice, and honestly? iconic repetition, no notes. π
β¨ Synopsis β¨
static coroutine_handle from_promise( Promise& p ); (since C++20)
Creates a coroutine_handle from the promise object of a coroutine. The created coroutine_handle refers the coroutine, and promise() returns a reference to p. π
β οΈ The behavior is undefined if p is not a reference to a promise object. Thatβs the dramatic part, bestie β do not play with that. π
This function is only provided for the primary template, i.e. specializations std::coroutine_handle<> and std::coroutine_handle<std::noop_coroutine_promise> do not have this function. The way that itβs primary-template-only is giving very exclusive club energy. π
πΈ Parameters πΈ
pβ promise object of a coroutine to refer
π Return value π
A coroutine_handle referring the given coroutine. β¨
π¦ Example π¦
This section is incomplete
Reason: no example
not me reading βno exampleβ and feeling personally attacked ππ β but fr fr, thatβs what it says.
π See also π
constructorβ constructs acoroutine_handleobject (C++20) (public member function)from_addressβ imports a coroutine from a pointer[static](C++20) (public static member function)noop_coroutineβ creates a coroutine handle that has no observable effects when resumed or destroyed (C++20) (function)
π·οΈ Category π·οΈ
- Todo no example
thatβs the whole category, lowkey minimal, highkey honest. π
mwah π β source/version: http://cppreference.com, dated 2024.06.10, and the footer tag is std::corout...from_promise(3). bye bestie, go handle your coroutines responsibly π«Άπ
π¦ 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