title: Why is this allocation of a vector not accepted?
body: <p>So I have declared a vector in my class header like this:</p>
  
  <pre><code> ...
   private:
      vector&lt;Instruction&gt; instructions;
   ...
  </code></pre>
  
  <p>Then in the .cpp implementation in the constructor, I try to initialize it like this:</p>
  
  <pre><code> instructions = new vector&lt;Instruction&gt;();
  </code></pre>
  
  <p>Xcode tells me: <code>No viable overloaded '='</code></p>
  
  <p>I am basically trying to get this class to behave like I would expect in java, where instances of the class retain this vector. Thats why I wanted to dynamically allocate it using <code>new</code>, so as to make sure that it doesn't get lost on the stack or something. Any help would be appreciated with this, thanks so much.</p>