thoughts on immutability in D
Jonathan M Davis
jmdavisProg at gmx.com
Fri Sep 23 18:55:49 PDT 2011
On Friday, September 23, 2011 18:39:19 Walter Bright wrote:
> On 9/23/2011 5:31 PM, Jonathan M Davis wrote:
> > I have to specifically circumvent the compiler to be
> > able to alter const stuff.
>
> Nope, not with 'mutable' you don't have to circumvent anything. Just change
> it.
True, but it doesn't just happen. You have to choose to make a variable
mutable. _Some_ effort must be put in to circumvent const. Until you do that,
const protects it from be changed.
By no means am I claiming that C++'s const is without flaws. I'm just claiming
that it's not worthless, and you seem to be claiming that it's worthless.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list