std::generator::begin(3)

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

✨ NAME ✨

Hii bestie πŸ’– this is the std::generator::begin page from the C++ Standard Library manual, and it's giving β€œiterator entrance era” πŸŽ€βœ¨

πŸŒ€ Synopsis πŸŒ€

/*iterator*/ begin();  (since C++23)

Okay so begin() pushes coroutine_ into *active_ stack, then evaluates coroutine_.resume(). Slay πŸ’…

Before you invoke begin(), coroutine_ must refer to a coroutine that is suspended at its initial suspend point. No cap. πŸ¦‹

🎁 Return value 🎁

You get an iterator whose coroutine_ member refers to the same coroutine as coroutine_ does. Iconic. 🫢

πŸ’… Notes πŸ’…

Calling begin() more than once on the same generator object is undefined behavior. Periodt. Do not do it, bestie πŸ˜­πŸ’€

🌈 Example 🌈

This section is incomplete.

Reason: no example.

πŸŽ€ Category πŸŽ€

  • Todo no example

xoxo, sourced from cppreference.com πŸ’– version/date 2024.06.10 πŸ’– page std::generator::begin(3) πŸ’…

πŸ“¦ where this page comes from