template<typename T>
void func()
{
T::A a;
}
The compiler does not know if T::A is a type. It could be several other things, which will only be known when the template is instantiated. You need the 'typename' qualifier here.
Reference: More Exceptional C++

No comments:
Post a Comment