PhobosWatch: manifest => enum

Walter Bright newshound1 at digitalmars.com
Sat Dec 29 14:43:28 PST 2007


Jérôme M. Berger wrote:
> Walter Bright wrote:
>> Yes, that could be done, but we're still stymied by the problem that we
>> are unable to declare a constant of type 'int', only 'const(int)'.
> 
> 	I don't see any situation in which we would need a constant of type
> "int" instead of "const (int)" or "invariant (int)". After all, if
> it is a *constant*, it should be either "const" or "invariant", no?

Consider the following:

	const int X = 3;
	auto i = X;
	i = 4;		// error, i is const

Essentially, it would make type inference far less useful.



More information about the Digitalmars-d mailing list