4 ms·
Good point. Let me correct that: if you return something that doesn't have a name, or is a local variable in the function you're returning from, it will always
by int_19h 10y ago
Good point. Let me correct that: if you return something that doesn't have a name, or is a local variable in the function you're returning from, it will always be moved. Usually it amounts to the same thing, except when non-const lvalue or rvalue references are involved (but it's fairly rare to return via a non-const reference).
- jnordwick 10y agoSo when I said RVO, I mean't NRVO too (but not from an argument passed in).