digitalmars.D.learn - Constness understanding
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
Nov 30 2015
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.
Nov 30 2015
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.
Nov 30 2015