2 ms·
This is indeed an amazing feature, and good languages copy ideas from each other. I believe C# has had this for years. C++ just got it with C++20 coroutines, th
by StellarScience 4y ago
This is indeed an amazing feature, and good languages copy ideas from each other. I believe C# has had this for years. C++ just got it with C++20 coroutines, though it still takes some work to use since std::generator didn't make it into C++20.
Lest folks think this is a new feature, it was invented by Barbara Liskov in her CLU language, as explained in this 1977 paper: https://web.eecs.umich.edu/~weimerw/2011-6610/reading/liskov-clu-abstraction.pdf https://web.eecs.umich.edu/~weimerw/2011-6610/reading/liskov... (PDF, see section 4.2.)