title: C++ standard list and default-constructible types
body: <p>Why is that the single parameter constructor of <code>std::list&lt;T&gt;</code> requires <code>T</code> to be a default-constructible type? I mean the following code does not compile. </p>
  
  <pre><code>struct Foo { // does not have default constructor.
    Foo (int i) {} 
  }
  int main(void) {
    std::list&lt;Foo&gt; l(10);
  }
  </code></pre>
  
  <p>It seems possible to use the <a href="http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Generic_Container_Idioms" rel="nofollow noreferrer">construct and destroy idioms</a> as they have already done in the std::vector, albeit with more book-keeping the list class. </p>
  
  <p>On a related note, why not have the capacity function in list? You can argue that such a function would pay memory allocation cost up-front and eliminate the overhead later on as you <code>push_back</code> objects. At least it will make the interfaces of two STL sequence containers slightly more consistent.</p>