std::corout...utine_handle(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

hiii bestie πŸ’– welcome to the C++ Standard Libary manual page for std::coroutine_handle::operatorcoroutine_handle β€” the header is literally out here as std::corout...utine_handle(3), truncated but iconic. this whole thing is a C++20 conversion-operator moment, and it's lowkey clean. πŸ¦‹

✨ NAME ✨

  • std::coroutine_handle::operatorcoroutine_handle β€” std::coroutine_handle::operatorcoroutine_handle. that's the NAME line, repeated exactly like that. this is the page for the conversion operator that turns a std::coroutine_handle<Promise> into a std::coroutine_handle<>. the promise type gets erased, no cap. πŸ’…

πŸ¦‹ Synopsis πŸ¦‹

constexpr operator coroutine_handle<>() const noexcept;  (since C++20)

okay so this conversion function converts a std::coroutine_handle<Promise> value to a std::coroutine_handle<> holding the same underlying address. it effectively erases the promise type. that's the whole vibe. ✨

πŸŽ€ Parameters πŸŽ€

  • (none) β€” not a single parameter. the section says none and it means none. πŸ’€

🌸 Return value 🌸

  • std::coroutine_handle<>::from_address(address()) β€” that's the return value, character for character. no notes, just that expression. 🫢

πŸ’œ See also πŸ’œ

  • operator== β€” compares two coroutine_handle objects. πŸ‘‘
  • operator<=> (function) β€” (C++20). 🌈

before you go: source/version and date on this one are http://cppreference.com and 2024.06.10, for std::corout...utine_handle(3). mwah, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from