I have a vector of size = N where each element i can have values from 0 to possible_values[i]-1. I want to do a function that iterates me through all those values.
I was
Generators in C++ aren't trivial but still possible with a bit of black magic:
http://www.codeproject.com/Articles/29524/Generators-in-C
You can look at answers to Safe cross platform coroutines because attempts to actually emulate python "yield" (including PEP 342) will bring you to some coroutine implementation anyway.
If you want to solve your problem in C++ way, it's more common to use an object for storing state of your "non-generator" method.