title: How to force reserve() to use a non-default constructor?
body: <p>Suppose we have the following code snippet:</p>
  
  <pre><code>MyType::MyType();            // size of MyType.aMember is a default size
  MyType::MyType(int mySize);  // size of MyType.aMember depends on mySize
  ...
  ...
  std::vector&lt;MyType&gt; myTypeVector;
  myTypeVector.reserve(numberOfObjects);  // memory reserved is numberOfObjects * sizeof(MyType)
  ...
  </code></pre>
  
  <p>How can one make reserve not use the default constructor to determine the size of the individual objects, but use a desired constructor instead?</p>
  
  <p>One can try the following:</p>
  
  <pre><code>MyType::MyType();            // size of MyType.aMember is a default size
  MyType::MyType(int mySize);  // size of MyType.aMember depends on mySize
  ...
  ...
  std::vector&lt;MyType&gt; myTypeVector(numberOfObjects, MyType(desiredSize));  // memory allocated is numberOfObjects * sizeof(MyType(desiredSize))
  ...
  </code></pre>
  
  <p>But the above calls the copy constructor which I would like to avoid for efficiency reasons. Hence my question.</p>