Final, Const, Invariant

Walter Bright newshound at digitalmars.com
Mon Mar 26 01:57:40 PDT 2007


Don Clugston wrote:
> My code has const everywhere. In fact, I use 'const' about ten times as 
> often as 'static' or 'class'. And the new scheme does not seem to have a 
> direct equivalent for it. How can I say, "I want to refer this literal 
> by a name, but in all other respects I want it to behave exactly as a 
> literal"? In particular, I do not want storage associated with it 
> (attempting to take its address is a bug), and it should work with CTFE.

Replacing const with final should do the trick.



More information about the Digitalmars-d mailing list