std::corout...from_address(3)
π NAME π
std::coroutine_handle::from_address β yep, that's the name, and it's literally std::coroutine_handle::from_address. We're in the C++ Standard Libary manual, bestie, and this function is here to turn an address into a coroutine handle. Slay.
β¨ Synopsis β¨
static constexpr coroutine_handle from_address( void *addr );
(since C++20)
Creates a coroutine_handle from a null pointer value or an underlying address of another coroutine_handle. The underlying address of the return value is addr.
π¨ Undefined behavior warning, no cap: behavior is undefined ifaddris neither a null pointer value nor an underlying address of acoroutine_handle. Behavior is also undefined ifaddris an underlying address of astd::coroutine_handle<P1>, where bothPromiseandP1are notvoid, andP1is different fromPromise. Like, do not play with that. π
This function is not declared for the specialization std::coroutine_handle<std::noop_coroutine_promise>.
π Parameters π
addrβ underlying address to import.
π¦ Return value π¦
A std::coroutine_handle<Promise> whose underlying address is addr.
πΈ Notes πΈ
If addr is not a null pointer value, it must be obtained from a prior call to address() on a coroutine_handle referring to some coroutine. That's the vibe check: get it from a real prior address() call, bestie.
π Example π
This section is incomplete.
Reason: no example.
π See also π
constructorβ constructs acoroutine_handleobject (C++20) (public member function)from_promiseβ creates acoroutine_handlefrom the promise object of a coroutine [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 page, bestie! Big thank-you to cppreference.com for the source, dated 2024.06.10 β mwah πβ¨π
π¦ 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