
"David Abrahams" <dave@boost-consulting.com> wrote in message news:ullg6287u.fsf@boost-consulting.com...
"Alex Chovanec" <achovane@engin.umich.edu> writes:
The 'is_iterator' struct template is a model of the "integral constant expression" concept. Thus, 'is_iterator<T>::value' evaluates to true if-and-only-if type T defines iterator traits
I don't believe that's detectable without generating an error. Don't forget that iterator_traits can be specialized; there's no reason the iterator has to contain members. Quick test: what is is_iterator<int*>::value?
I don't really see why this a problem. 'is_iterator' can be specialized too, and that is what I have done for the case of pointers: template <typename T> struct is_iterator<T *> { typedef is_iterator type; typedef bool value_type; BOOST_STATIC_CONSTANT(value_type, value = true); }; So 'is_iterator<int *>::value' evaluates to true without generating a compile error, as it should. Alex