Why does std::vector::resize(n, src) pass by value?
<p>Pretty much as per the title.</p>

<p>The spec for <code>std::vector&lt;T&gt;::resize</code> seems to require that the <code>src</code> object be passed by value:</p>

<pre><code>void resize(size_type n, T src = T() );
</code></pre>

<p>Why isn't a reference to a constant object used here instead?</p>

<pre><code>void resize(size_type n, T const&amp; src = T() );
</code></pre>

<p>For instance, in <a href="http://stackoverflow.com/questions/7438968/segmentation-fault-on-resizing-a-vector-of-large-structures">this question</a>, the pass-by-value aspect appears to cause stackoverflow issues, due to the creation of a temporary object on the stack. </p>

<p>If a reference to <code>src</code> was passed instead, we'd at least be able to workaround the issue by allocating a temporary on the heap which is passed-by-reference to <code>::resize()</code>.</p>

<p>It also seems that <code>::resize()</code> is out of step with the other member functions for <code>std::vector</code>. For instance, the constructors take a <code>src</code> object by <code>const&amp;</code> as expected:</p>

<pre><code>vector (size_type n, T const&amp; src = T(), Allocator const&amp; = Allocator() );
</code></pre>

<p>EDIT: I dug out the <code>c++03</code> standard and double checked that the function prototypes above are not mis-quoted...</p>
