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