Another foolish idea for manifest constants

Robert Fraser fraserofthenight at gmail.com
Sat Dec 8 16:03:01 PST 2007


Bruce Adams wrote:
> 
> A 'manifest' constant is one that is never allowed to use any storage. 
> There is
> one 'type' for which this is already true - void.
> So how about:
> 
> void int x = 3;
> 
> This is a non-breaking change as using void this way is a syntax error.
> Granted void is not a storage class.

I don't think that's any better than "enum". And if it's used to infer 
type as in:

void str = "hello";

... it becomes a semantic error.



More information about the Digitalmars-d mailing list