How to break const

deadalnix deadalnix at gmail.com
Mon Jun 18 08:26:26 PDT 2012


Le 18/06/2012 17:20, Mehrdad a écrit :
> On Monday, 18 June 2012 at 15:19:26 UTC, deadalnix wrote:
>>
>> Yes, but this isn't a problem with pure here, this is a problem with
>> const.
>
> Hence the title...
>
>> The sample code should not compile.
>
> What should the error be? Is it correct in the language spec?

The specification lack on that point, because we are here facing a 
specification bug. Depending on how we choose to fix that, the error can 
be different.

Fix the initializer to dissalow the way you initialize c is probably the 
way to go on that specific case. Andrei says that work have been done in 
that direction, but I'm not aware of where it is now. It also require a 
way to qualify the frame pointer; which isn't possible ATM.


More information about the Digitalmars-d mailing list