On 18/08/07, John L. Kulp <jlkjr@bioleap.com> wrote:
Can anyone give me the rationale about why vector::resize passes
its last argument by value? On the surface it seems wrong to incur
the cost of copying for no reason I can see. Also, MSVC and gcc
disagree about whether the arg should be const. Again, is there
any reason it shouldn't be? Perhaps this has been discussed, in
which case could someone point me to that? Thanks. Note that
passing by value means that aligned vectors as required for SSE
code will fail to compile due to this.
See http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#679
for a summary of why it works like that today. I don't know if Howard
would recommend GCC should change the signature before that issue is
resolved one way or another.