playing with some generator ideas in c++