Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Variant broke in 1.54?
From: gast128 (gast128_at_[hidden])
Date: 2013-08-04 16:18:25


> 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...


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net