Vadim Lopatin:

Const sub-tree is object itself and its data.
Reference to object is outside of tree.
Why references to const object should be const?

There was a very long discussion on this. I think the short answer is to keep the syntax and semantics composed of a sufficiently low number of parts (in D you don't have syntax to tell apart objects from their references).

A D user wrote a patch to implement what you ask for, but it was essentially left to die in GitHub.

But there's Rebindable in Phobos.

Bye,
bearophile

Reply via email to