Constants, Aliases

Alexander Panek a.panek at brainsware.org
Thu Dec 14 04:53:20 PST 2006


Lutger wrote:
> Xinok wrote:
>> The problem with the const keyword is it doesn't guarantee the 
>> expression will
>> be constant.
> 
> It doesn't? How can you modify a const var then? (in D)

You can modify const variables that are not set directly at declaration 
(write-once constants) just by getting their address and modifying them 
through another variable/pointer.



More information about the Digitalmars-d mailing list