I have a function that needs to enumerate an iterator multiple times, but according to MSDN, \"Once you increment any copy of an input iterator, none of the other copies can
You can do this using std::enable_if:
std::enable_if
#include #include #include template typename std::enable_if::iterator_category>::value, bool>::type EnumerateTwice(It begin, It end, TCallback) { ... }
This uses class from C++11 but all of this can be done in C++03 as well.