c++ Child class Unable to initialize Base class's member variable?
问题 So this question adds to my previous question about initializing member vector in an initialization list.. Here are my base & derived class definitions... class Base { public: std::vector<int> m_Vector; } class Derived : public Base { Derived() : m_Vector {1, 2, 3} {} // ERROR when referring to m_Vector } When trying to initialize Derived's m_Vector.. I get an error in Visual Studio saying that "m_Vector" is not a nonstatic data member or base class of class "Derived" Why can't derived class