Dependent types typically need typename to tell the compiler that it is a type, not a function or variable.
However, this is not always the case. For example, the base class does not require this, because it can only be a type ever:
template<class T> struct identity { typedef T type; } template<class T> class Vector : identity<vector<T> >::type { };
Now my question is: why does typedef ever require typename after it ?
template<class T> class Vector { typedef typename vector<T>::iterator iterator; };
c ++ typedef typename
Mehrdad Feb 07 '14 at 10:22 2014-02-07 10:22
source share