Some attempt at python-style generators in C++