title: Allocating std vector content with dynamic objects
body: <p>I have a
  <code>std::vector&lt; MyObject* &gt; my_vector;</code>
  Which is not empty and i want to allocate and push a certain amount of MyObject* in it.
  I know the number of objects to push. Is there a better way (optimized/faster) to do it than:</p>
  
  <pre><code>int object_count = 10000;
  for(int index = 0; index &lt; object_count; index++)
  {
      my_vector.push_back(new MyObject());
  }
  </code></pre>
  
  <p>Like allocating in one call of malloc for all the MyObject and then memcpy the result to my_vector.
  Any idea?</p>
  
  <p><strong>Update</strong>
  My issue is the call to new 10000 times. I want to be able to allocate one big chunk of memory and swaping the memory to the end of my_vector.</p>