The Status of Const

Graham St Jack Graham.StJack at internode.on.net
Thu Aug 12 17:43:27 PDT 2010


On 13/08/10 10:08, Andrei Alexandrescu wrote:
> Trass3r wrote:
>> Well isn't it natural that a constness system has a much larger 
>> impact than just some syntax additions.
>> I don't see any flaws in its design. The implementation is of course 
>> still buggy though and needs to mature.
>
> I agree. There are very severe bugs and undue limitations in today's 
> const. Having a comprehensive discussion of const's status and role in 
> current and future D idioms is a great idea. We should start it with a 
> scrutiny of the reported and possibly unreported bugs in the feature.
>
>
> Andrei
I also agree that cost is worth the effort.

Most of the roadblocks are relatively easy to overcome by rolling 
const-correctness through druntime and phobos.

However, I still regard the language design decision of a class 
reference having the same constness as the object it refers to as a 
major language design problem. I would be delighted if someone could 
point out to me how to neatly work around this though.

-- 
Graham St Jack



More information about the Digitalmars-d mailing list