2 ms·
http://en.wikipedia.org/wiki/Return_value_optimization http://en.wikipedia.org/wiki/Return_value_optimization TL;DR: Modern languages can tell when you're goin
by steveklabnik 12y ago
http://en.wikipedia.org/wiki/Return_value_optimization http://en.wikipedia.org/wiki/Return_value_optimization
TL;DR: Modern languages can tell when you're going to be returning a value, and just place the return in the right place, rather than making a copy that'd just get thrown away. I believe this is what they're referring to.
It also might be talking about how just the tag gets copied, and not all the values. I think.
- Jare 12y agoYeah RVO is clear, I'm confused about the "pass by value" which I assume is as a parameter to a function, where a creating a copy is unavoidable in the general case.
- steveklabnik 12y agoI pinged the author, and they said: > there is no implicit heap allocation, there is explicit heap allocation when you create the String, but not when you're just moving it around