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 use SFINAE and replace bool
by:
typename enable_if<
is_same::iterator_category,
std::forward_iterator_tag>::value,
bool>::type
You may need to define is_same
and enable_if
yourself if you don't want to pull them from Boost or TR1:
template
struct is_same { static const bool value = false; };
template
struct is_same { static const bool value = true; };
template struct enable_if { };
template struct enable_if { typedef T type; };