Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Variant broke in 1.54?
From: gast128 (gast128_at_[hidden])
Date: 2013-08-07 12:02:07


> I am aware of the syntax and its meaning. I specified "meaningless" not
> because the syntax is meaningless ( if it was the compiler would issue
> an error about the syntax itself ) but because the practical use of
> specifying 'const' in either situation is meaningless IMO. You are
> getting a copy of some X. Why would you practically specify that this
> copied value cannot be changed ? I do not see a practical programming
> reason for doing anything that way despite your correctly formed
> examples above.

See item 21 'use const whenever possible 'of 'Effective C++', second
edition. It is more to protect the programmer for accidental modifying temp
objects which is probably a bug. With move ctor's there is actually a use
case of modifying / stealing temp objects.


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