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

Chris Cain clcain at uncg.edu
Thu Aug 16 21:25:42 PDT 2012


On Friday, 17 August 2012 at 04:17:33 UTC, Mehrdad wrote:
> Okay so basically, the conclusion I'm drawing is that you have 
> to combine it with pure/immutable in order to get much more out 
> of it than compared with C++; otherwise, it's not really 
> different.
>
> Thanks!

You posted this before seeing the additional clarifications Mr. 
Davis and I posted, and I understand that, but I just wanted to 
say that factoring what we both said I think it's clear that it 
is really different. Not bulletproof (I'd say const + pure would 
be nearly bulletproof and immutable + pure would truly be 
bulletproof if you started considering multi-threading), but 
certainly better than C++.


More information about the Digitalmars-d mailing list