Thanks hamsterman; yes, it is variable & i shouldn't use it. But still my problem persist. Can you please point it? I am a beginner & learning templates.
The compiler doesn't know if std::vector<T>::iterator is a type or not. Someone could make a template specialization for std:vector<int> and make std:vector<int>::iterator a function, variable or something else, so what it is depends on the type T. typename is needed here to tell the compiler that it is a type, otherwise it will assume it's not a type.