
Here's something that I have been using on C++03 compilers to check if its an iterator. It is somewhat similar, except it checks additionally for `reference` and `pointer`. template<class T1 = void, class T2 = void, class T3 = void, class T4 = void, class T5 = void> struct holder { typedef void type; }; template<class T, class X = void> struct is_iterator : boost::mpl::bool_<false> {}; template<class T> struct is_iterator<T*> : boost::mpl::bool_<true> {}; template<class Iterator> struct is_iterator<Iterator, typename holder < typename Iterator::iterator_category, typename Iterator::reference, typename Iterator::pointer, typename Iterator::value_type, typename Iterator::difference_type >::type > : boost::mpl::bool_<true> {};
If there is interest, and John Maddock gives the OK, I'll write docs and integrate into type_traits, then submit a pull request.
I definately think it is something very useful to have. Perhaps, it should go in Boost.Iterator instead? -- View this message in context: http://boost.2283326.n4.nabble.com/type-traits-Interest-in-is-iterator-type-... Sent from the Boost - Dev mailing list archive at Nabble.com.