mutable reference to const object

bearophile bearophileHUGS at lycos.com
Thu Mar 6 07:59:11 PST 2014


Vadim Lopatin:

> In C++, following code works as I'm expecting:

Different language, different (hopefully better) semantics. In D 
const and immutable are transitive, this means they make 
const/immutable the whole sub-tree of data they refer to:
http://dlang.org/const3.html

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list