On Thu, Apr 22, 2010 at 11:43 AM, Robert Jones <robertgbjones@gmail.com> wrote:Returning containers by value seems to be the 'right way' now, as RVO should
sort out the copy elision.
I'm not convinced that this is the 'right way'. I find that for trivial examples the copy is optimized away, but that on many compilers at various levels of call depth the copy construction occurs causing a huge performance degradation. I suspect that the 'right way' is still by using references in C++03 and by using move constructors in C++0x.