Inherited const when you need to mutate
Walter Bright
newshound2 at digitalmars.com
Tue Jul 10 15:39:30 PDT 2012
On 7/10/2012 3:13 PM, H. S. Teoh wrote:
> I don't think they were rushed. There's been a push for making druntime
> and Phobos const-correct for a while now. I don't think this change is a
> _mistake_ per se, but it does expose a flaw in the language: const is
> too limited in scope, and we need something else to fill in for use
> cases where const isn't good enough.
There's a gigantic problem with logical const. It is completely unenforceable -
it is documentation only. All the reasoning and mechanical guarantees that come
with const, immutable, and purity fall apart.
More information about the Digitalmars-d
mailing list