This is an exact duplicate of this question, except that accepted answer is wrong, so I ask it again:
How do you correctly check to see if
I implemented this one some time ago:
template
struct is_iterator {
template
static char test(typename std::iterator_traits::pointer* x);
template
static long test(U* x);
static const bool value = sizeof(test(nullptr)) == 1;
};
It compiles fine using your example. I can't test it on VC though.
Demo here.