
5 Dec
2010
5 Dec
'10
12:18 a.m.
On 12/4/2010 4:11 PM, Peter Foelsche wrote: [...]
Anybody know in which cases the compiler optimizes away or does not optimize away the call to the copy-constructor when returning an object by value?
http://en.wikipedia.org/wiki/Return_value_optimization
I still think that something like this should be available in some library for people, which cannot write such a wrapper in a few minutes by themselves.
I think the point is that copy-on-write is rarely optimal, often suboptimal, and increases complexity; hence it should not be encouraged. - Jeff