title: Can a C++ class contain a vector?
body: <p>So, I was trying to instantiate an object of a class containing a vector in C++, and compiler gave me an incomplete type error. I have simplified the code to as follows:</p>
  <pre><code>#include &lt;vector&gt;
  class Test;
  int main(){Test vector;}
  class Test{ std::vector&lt;int&gt; vector;};
  </code></pre>
  <p>I am assuming that this is because the vector is not of a defined size, so the computer doesn't know how to allocate memory for it. How do I get around this issue? Sorry for the beginner question.</p>