From: Walter Bright on 28 Mar 2010 09:34
Dave Harris wrote:
> However, it's not at all
> clear that const would be worth adding to other languages, and indeed I
> don't think any other languages have it (I'm excluding things like Java
> which have only a half-baked version).
The D programming language has const. It differs from C++ const in that D const
is transitive, and D also supports a transitive "immutable" qualifier that
guarantees that the data won't be changed via another mutable reference.
In other words, const means the data cannot be modified through this reference,
and immutable means it cannot be modified via any reference. This is handy for
things like concurrent programming, where immutable data does not need
free C, C++, D programming language compilers
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]