www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: PhobosWatch: manifest => enum

Derek Parnell Wrote:

 On Fri, 28 Dec 2007 10:35:38 -0800, Walter Bright wrote:
 Sean Kelly wrote:
 The weird thing for me is that this will allow individual enums of any 
 type but grouped enums of only numeric types.

The following will work: enum { x = 3, // x is int y = 4L, // y is long } The idea is that for anonymous enums, there is no type for the enumeration as a whole. Therefore, each member of the enumeration can have a different type.

Will your syntax allow declarations of single values? e.g. enum x = 3; enum y = 4L; Or will we have to use the {} form? enum {x = 3} enum {y = 4L} -- Derek Parnell Melbourne, Australia skype: derek.j.parnell

You'll be able to do
   enum x = 3;
   enum y = 4L;

It's here somewhere in this thread already.
Dec 28 2007