What guarantees does D 'const' provide, compared to C++?

Jesse Phillips jessekphillips+D at gmail.com
Sun Aug 19 12:26:56 PDT 2012


On Saturday, 18 August 2012 at 11:26:01 UTC, Peter Alexander 
wrote:

> const on its own provides no guarantees, it just imposes 
> restrictions so that immutable can provide guarantees.

While in context with the original question this is fine, but I 
do not like this use of guarantee.

What I mean is, const does provide guarantees by itself. And it 
provides more than C++ because it is transitive and modifying a 
const reference is undefined.


More information about the Digitalmars-d mailing list