title: C++ Create objects in a loop with a given constructor
body: <p>I was on my way to create a class that would mimic <code>std::vector</code> to a certain extend. </p>
  
  <p>I quickly faced a problem where I couldn't create an array of objects which didn't have a default constructor. I found the answer here <a href="https://stackoverflow.com/a/4756306/8106847">https://stackoverflow.com/a/4756306/8106847</a> which allowed me to do just that. But the problem now is I'm stuck to one certain constructor. </p>
  
  <p>How do I pass any constructor like 
  <code>std::vector&lt;Obj&gt;(100, Obj(1, "str"))</code>
  does ?</p>
  
  <p>(or is it far too complicated for anyone who's not senior C++ developer?)</p>