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

Reply via email to