Template inheritance and a base member variable
问题 I get a weird error when trying to use template inheritance. This is my code: template <class T> class A { public: int a {2}; A(){}; }; template <class T> class B : public A<T> { public: B(): A<T>() {}; void test(){ std::cout << "testing... " << a << std::endl; }; }; And this is the error: error: use of undeclared identifier 'a'; did you mean 'std::uniform_int_distribution<long>::a'? void test(){ std::cout << "testing... " << a << std::endl; } And in case it could affect something I use these