3 ms·
This issue is why D has both const and immutable qualifiers. const can't be optimized because there may be other mutable references to the same memory object. B
by WalterBright 7y ago
This issue is why D has both const and immutable qualifiers. const can't be optimized because there may be other mutable references to the same memory object. But for immutable references, there cannot be.
It is possible to cast away const and immutable in D, but these are only allowed in system code, presumably where the programmer actually does know what he's doing.