specializing iterator_traits
问题 I'd like to specialize std::iterator_traits<> for iterators of a container class template that does not have the usual nested typedefs (like value_type , difference_type , etc.) and whose source I shouldn't modify. Basically I'd like to do something like this: template <typename T> struct iterator_traits<typename Container<T>::iterator> { typedef T value_type; // etc. }; except that this doesn't work, as the compiler is unable to deduce T from Container<T>::iterator . Is there any working way