title: Initial capacity of vector in C++
body: <p>What is the <code>capacity()</code> of an <code>std::vector</code> which is created using the default constuctor? I know that the <code>size()</code> is zero. Can we state that a default constructed vector does not call heap memory allocation?</p>
  
  <p>This way it would be possible to create an array with an arbitrary reserve using a single allocation, like <code>std::vector&lt;int&gt; iv; iv.reserve(2345);</code>. Let's say that for some reason, I do not want to start the <code>size()</code> on 2345.</p>
  
  <p>For example, on Linux (g++ 4.4.5, kernel 2.6.32 amd64)</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  int main()
  {
    using namespace std;
    cout &lt;&lt; vector&lt;int&gt;().capacity() &lt;&lt; "," &lt;&lt; vector&lt;int&gt;(10).capacity() &lt;&lt; endl;
    return 0;
  }
  </code></pre>
  
  <p>printed <code>0,10</code>. Is it a rule, or is it STL vendor dependent?</p>