Implicit enum conversions are a stupid PITA

yigal chripun yigal100 at gmail.com
Tue Mar 23 15:56:05 PDT 2010


yigal chripun Wrote:

> A C style enum with values assigned is *not* an enumeration but rather a set of meaningful integral values and should be represented as such.
> 

The above isn't accurate. I'll re-phrase:
The values assigned to the members of the enums are just properties of the members, they do not define their identity. 
void bar(int);
bar(Color.Red.rgb); // no-problem
bar(Color.Red); // compile-error



More information about the Digitalmars-d mailing list