This is the statement from ISO C++ Standard 14.6/6:
Within the definition of a class template or within the definition of a member of a class template, the keyword
typename
is not required when referring to the unqualified name of a previously declared member of the class template that declares a type. The keywordtypename
shall always be specified when the member is referred to using a qualified name, even if the qualifier is simply the class template name. [Example:template<class T> struct A { typedef int B; A::B b; // ill-formed: typename required before A::B void f(A<T>::B); // ill-formed: typename required before A<T>::B typename A::B g(); // OK };
The keyword typename is required whether the qualified name is
A
orA<T>
becauseA
orA<T>
are synonyms within a class template with the parameter list<T>
. ]
Is this statement is true while inheritance?
If yes, can anyone explain this?
I checked with inner class; it is accepted? But I am unable to check with inheritance?