Transitive const sucks

Bruno Medeiros brunodomedeiros+spam at com.gmail
Tue Sep 11 14:00:01 PDT 2007


Sean Kelly wrote:
> read operations.  But for better or worse, D const has a different aim. 
>  The goal is largely to produce a system which allows for compiler 
> optimization rather than to enforce some sort of logical restrictions on 
> behavior.  I suspect this means that D apps won't look very much like 
> C++ apps in terms of how const is used, and the overall utility for the 
> average programmer may well be somewhat small.
> 
> 
> Sean

I'm don't think that's entirely true. 'invariant' the keyword is indeed 
made to allow several compiler and program optimizations, but 'const' 
the keyword is really for enforcing program contracts and restrictions, 
thus improving safety. I don't even think 'const' the keyword has any 
use whatsoever for optimization.


-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list