3 ms·
C++20 coroutines didn't include the facilities to get a coroutine directly from writing a loop with the `yield` keyword like in Python. You can see all the boil
by blt 4y ago
C++20 coroutines didn't include the facilities to get a coroutine directly from writing a loop with the `yield` keyword like in Python. You can see all the boilerplate needed in this post's `Generator` class. For me, it made the feature not worth using.
I'm excited that C++23 is getting `std::generator`, so we can finally write those simple loops: https://en.cppreference.com/w/cpp/coroutine/generator https://en.cppreference.com/w/cpp/coroutine/generator