This is perfectly fine, right? And it is more efficient, right? Why did Scott Meyers not use reference in the above example (almost suggesting that you shouldn't)?
-> No. You are returning a reference to an object that no longer exists. 'v' has a lifetime only in the lambda function.
Perhaps Scott Meyers hastily thought the same thing when he wrote his example without the reference? When is a case where you would not want to use a reference? After all, it is const. Even if it wasn't const, I still don't see why not use a reference anyway.
The context of Scott Meyers' example is that such an object, which would require lines of code to construct, would otherwise not be const after the construction. You can imagine his example being more complex. So by using a lambda function, it can be made const. That's all.