The biggest problem I see in doing this is that since C++ does not have yield statements / coroutines / continuations you need to write the iterator code "inside out" and with explicit state, something that usually ends up harder to read than a regular nested-for-loop iteration.