PhobosWatch: manifest => enum

Walter Bright newshound1 at digitalmars.com
Fri Dec 28 10:43:38 PST 2007


Sean Kelly wrote:
> err... make that unnamed and named.  One could argue that support for 
> unnamed enums is simply for ease of porting from C rather than because 
> it's a feature that really makes sense in a new language.  So making it 
> even more entrenched is undesirable.  But we need the feature and if 
> "enum" is it then...

Right. Anonymous enums are already conventionally used not to declare 
enums, but a bunch of (not necessarily related) manifest constants. In 
fact, in C++ we see:

template<> class factorial<1>
{
   public:
     enum { result = 1 };
};

where anonymous enums are clearly used to declare manifest constants.



More information about the Digitalmars-d mailing list