How do I move a pointer in C++?
<p>This is a stupid question but I just have no idea how to accomplish this.</p>

<p>I have an object and a vector. At a set time during execution, I need to put this object in the vector and overwrite this object with a new one. I currently have this, </p>

<pre><code>std::vector&lt;Cube*&gt; cubes;
Cube* workingCube = new Cube();
...
cubes.insert(cubes.begin(), workingCube);
workingCube = new Cube();
</code></pre>

<p>which I assume is wrong because of some pointer-related reason. I can't figure out how to do this properly though.</p>
