Constants, Aliases
Alexander Panek
a.panek at brainsware.org
Thu Dec 14 05:02:38 PST 2006
Hasan Aljudy wrote:
>
>
> 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.
Hahaha, yea. I don't get what const would change there, either. X-P
More information about the Digitalmars-d
mailing list