4 Aug
2013
4 Aug
'13
8:18 p.m.
Returning a 'const X' is meaningless. Just return 'X' instead. The same goes for passing something as 'const X'. When you pass or return by value you get a copy of the object being passed so it means nothing to say that the object is 'const'.
It's a recommendation of Scott Meyers, so that u cannot modify a temporary object. In the world of move constructors these days, that recommendation has become less valid. Having said that, your solution to this broken code is not to use it in the first place? Ofc I could have thought of that myself...