There's a previous implementation of itertools in C++: https://github.com/ryanhaining/cppitertools.
BTW your handle rung a bell. I was wracking my brain to remember where have I heard of it before, then finally, oh yes MacSTL. It really deserves more love. Have not used it, but sure browsed the code.