
29 Aug
2011
29 Aug
'11
5:22 p.m.
so I would just leave the move and do a `return v;` relying on the fact that even my C++03 my compiler will do RVO and in-place construction of the returned vector anyway.
a year ago I check carefully what gcc would do by inspecting the assembler code generated and indeed it does in-place construction. I since then carelessly always return objects by copy, and when I convert portion of the code that was returning by ref to return by copy I usually do not observe any performance slow-down (although I must say do not always check). Nil