PhobosWatch: manifest => enum

Bastiaan Veelo Bastiaan at Veelo.net
Sun Dec 30 03:10:15 PST 2007


Walter Bright wrote:
> Let me enumerate (!) the enhancements to enum:
> 
> 1) The enum 'base type' is no longer restricted to being integral types 
> only.
> 2) Members of anonymous enums can now be of heterogeneous types, the 
> types being deduced from their initializers.
> 3) .init, .min and .max have no meaning for anonymous enums, and so are 
> computed only for tagged enums.
> 4) For anonymous enum members, a type can prefix the identifier as a 
> convenience.
> 5) If there is only one member in an anonymous enum, the { } can be 
> omitted.
> 6) If .init, .min, .max or 'next' values are not required, then the base 
> type doesn't have to support the operations required to produce those 
> values.

You can regard me as a newcomer. In my view, enums are often used in 
support of switch statements. If you are loosening up enums so its 
members can be of heterogeneous types, will you be loosening up 
switch/case as well? If not, that would be confusing to me, as you will 
be able to switch on some enums but not on others.

Sincerely,
Bastiaan.



More information about the Digitalmars-d mailing list