move from the return line: Either way you've got a dangling reference to a local variable inside the function and which has been destructed. – Howard Hinnant Feb 27 '13 at 16:11
| 1 | upvote |
| ? | flag |
tmp) in the Best practice section, it is the NRVO that kicks in, not the RVO. These are two different optimizations. Other than that, great answer! – Daniel Frey Feb?