On Thursday, 18 February 2016 at 22:48:01 UTC, Walter Bright wrote:
struct A { int* pi; }

and *pi will be mutable even though pi is __const.

Here's the big deal: when you have started on an implementation with constness in, and then evolve the codebase and have to turn some fields mutable or face a major rewrite, guess what you will do?

You will look for ways to save time and cast away constness, write some comment that it probably should be fixed later, but if it looks like it is working it will never be fixed...

So you effectively cannot avoid "mutable". You can claim they shouldn't do it, but you cannot enforce it.

Reply via email to