title: Preventing std::vector from resizing on push_back
body: <p>I have a std::vector that I know will never have to grow--it will always have <code>n</code> elements (unfortunately, <code>n</code> isn't known at compile time so I can't use std::array). I can do:</p>
  
  <pre><code>std::vector&lt;blah&gt; v(n);
  </code></pre>
  
  <p>Which correctly sets its capacity to <code>n</code>. But when I proceed to fill <code>v</code> with <code>push_back</code>, it automatically resizes to <code>2n</code>.</p>
  
  <p>I realize this is premature optimization, but it's bugging me. Is there a way to set max size or something?</p>