I'm thinking, whether const is guaranteed _NOT_ to be put into read-only memory.
If so, then const can be safely used for "logical const" purposes.
I'd really like that, because then, const would be safe to cast away.
Since const does not contribute to anything else (in contrast to
immutable), it doesn't break anything to cast away const, except logic
(in some cases).
The most obvious case is to cast away const-ness of members of a class
from inside that class.

On Tue, Oct 25, 2011 at 4:23 PM, Jude Young <[email protected]> wrote:
> I'm sure that there is much more, but I immutable is set to global storage
> and not Thread Local Storage.
> I believe that const is stil TLS.
>
> On Tue, Oct 25, 2011 at 5:15 AM, Gor Gyolchanyan
> <[email protected]> wrote:
>>
>> What's the difference between const-declared variable and
>> immutable-declared variable?
>>
>> module a;
>>
>> const(int) a;
>> immutable(int) b;
>>
>> void main()
>> {
>> }
>
>

Reply via email to