title: Initializing sub-vectors of nested vectors with reserved capacity
body: <p>I want to create vector of vectors such that each sub-vector has a pre-defined capacity but is not initialized.</p>
  
  <p>Here is the code which doesn't do what I want to do:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main()
  {
      vector&lt;int&gt; tVec;
      tVec.reserve( 5 );
      cout&lt;&lt;"tVec Size: "&lt;&lt;tVec.size()&lt;&lt;", capacity: "&lt;&lt;tVec.capacity()&lt;&lt;endl;
  
      vector&lt; vector&lt;int&gt; &gt; tmpVecVec( 2, tVec );
      cout&lt;&lt;"tmpVecVec[0] Size: "&lt;&lt;tmpVecVec[0].size()&lt;&lt;", capacity: "&lt;&lt;tmpVecVec[0].capacity()&lt;&lt;endl;
      cout&lt;&lt;"tmpVecVec[1] Size: "&lt;&lt;tmpVecVec[1].size()&lt;&lt;", capacity: "&lt;&lt;tmpVecVec[0].capacity()&lt;&lt;endl;
  }
  </code></pre>
  
  <p>Output of above is:</p>
  
  <pre><code>tVec Size: 0, capacity: 5
  tmpVecVec[0] Size: 0, capacity: 0
  tmpVecVec[1] Size: 0, capacity: 0
  </code></pre>
  
  <p>I want to know how can I get the following result</p>
  
  <pre><code>tVec Size: 0, capacity: 5
  tmpVecVec[0] Size: 0, capacity: 5
  tmpVecVec[1] Size: 0, capacity: 5
  </code></pre>
  
  <p>Of course if I replace reserve with resize or provide size 5 in constructor of tVec, I can do this. But, can I do this without using these methods ?</p>
  
  <p>link to working code: <a href="http://ideone.com/PBXeP" rel="nofollow">http://ideone.com/PBXeP</a></p>