Constants, Aliases

Hasan Aljudy hasan.aljudy at gmail.com
Thu Dec 14 03:57:44 PST 2006



Alexander Panek wrote:
> 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.

So what!!
You can violate class encapsulation using pointers too, in fact you can 
even mess the v-table.



More information about the Digitalmars-d mailing list