Re: Constness understanding

2015-11-30 Thread Kagamin via Digitalmars-d-learn
Unfortunately in D constant doesn't mean constant :( it means 
readonly: you can read it, but it can change in other ways. 
Immutable means constant - doesn't change in any way.


Re: Constness understanding

2015-11-30 Thread drug via Digitalmars-d-learn

On 30.11.2015 13:27, Kagamin wrote:

Unfortunately in D constant doesn't mean constant :( it means readonly:
you can read it, but it can change in other ways. Immutable means
constant - doesn't change in any way.

Thanks, considering 'const' as 'readonly' explains my case rather well.


Constness understanding

2015-11-30 Thread drug via Digitalmars-d-learn
I have some struct and other struct stores reference to the first one 
like a pointer to constant. Nevertheless I can change the value of the 
first struct. Is it some hack?


http://dpaste.dzfl.pl/0dfa3dff2df7