Extended Type Design.

Andrei Alexandrescu (See Website For Email) SeeWebsiteForEmail at erdani.org
Wed Mar 21 23:57:44 PDT 2007


Kevin Bealer wrote:
> As I understand it, "const" means "readonly view of something", similar 
> to C++'s const but without the big "disable me" button.  The data is 
> live but "under glass".
> 
> "final const" means the compiler never generates code to modify the 
> underlying data and can assume (cache, do constant folding on) the 
> underlying data.  Almost like a #define, except that you can take the 
> address of it.
> 
> "invariant" is just like const, but refers to the symbol (and by 
> extension the data) rather than just the data.

Swap these two names.

Andrei



More information about the Digitalmars-d mailing list