any news on const/invariant?

Walter Bright newshound1 at digitalmars.com
Wed Nov 28 02:10:38 PST 2007


Janice Caron wrote:
> If we ditch
> const-as-an-attribute altogether, it would require only minor changes
> to get code compiling again: e.g.
> 
>     const int[] table = [ 1, 2, 3, 4 ];
> 
> becomes
> 
>     const(int[]) table = [ 1, 2, 3, 4 ];

I think it would be pretty hard to give up:

	const x = 3;

Also, C++ has const as both a storage class and a type constructor, and 
yes, they have subtly different meanings. This doesn't seem to cause any 
major problems.



More information about the Digitalmars-d mailing list