3 ms·
The parent is right about the copy elision part (http://en.wikipedia.org/wiki/Return_value_optimization http://en.wikipedia.org/wiki/Return_value_optimization).
by wynand 17y ago
The parent is right about the copy elision part (http://en.wikipedia.org/wiki/Return_value_optimization http://en.wikipedia.org/wiki/Return_value_optimization). GCC definitely performs this and I'm sure that it's true of other widely used C++ compilers.
I also don't know what yosefk means when he says that smart pointers rely on defective meta-programming techniques. The implementation of Boost's smart_ptr doesn't seem too esoteric to me.
- shin_lao 17y agoMore information about copy elision here: http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ http://cpp-next.com/archive/2009/08/want-speed-pass-by-value...