// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <generator>

using namespace std;

generator<int> pow2()
{
    for(int i = 1; i <= 10; i++)
    {
        co_yield i * i;
    }
}

int main()
{
    for(int v : pow2())
    {
        cout << v << endl;
    }
    return 0;
}
