3 ms·
This is common behavior for languages. D adds another wrinkle to it - a reference can be mutable, const, or immutable. mutable: can modify it const: cannot mo
by WalterBright 4y ago
This is common behavior for languages. D adds another wrinkle to it - a reference can be mutable, const, or immutable.
mutable: can modify it
const: cannot modify it through the reference, but other mutable references can still modify it
immutable: nobody can modify it
The 'immutable' is great for writing threaded code, as no synchronization is necessary.