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
Not tested but you could try something along the lines of:
template
bool EnumerateTwice_Interal(const It &begin, const It &end, TCallback callback,
std::forward_iterator_tag)
{
//do your things
}
template
bool EnumerateTwice(const It &begin, const It &end, TCallback callback)
{
EnumerateTwice_Internal(begin, end, callback,
typename std::iterator_traits::iterator_category());
}