EnumBaseType conversion

Nick Sabalausky a at a.a
Tue Jun 16 11:48:52 PDT 2009


"bearophile" <bearophileHUGS at lycos.com> wrote in message 
news:h18j5t$18q7$1 at digitalmars.com...
> Robert Fraser:
>> typedef int _MyEnum;
>> enum MyEnum : _MyEnum
>> {
>> FOO,
>> BAR
>> }
>
> Isn't it better for all enums to behave like this (and require a cast to 
> be used as their base types)?
>

Yes.

I also was unaware of this behavior and am rather dissapointed by it. This 
just smacks of the old problematic C-style weak-typing that I've spent years 
trying to avoid. I shouldn't need an idiom to do things the safe/correct 
way. 





More information about the Digitalmars-d mailing list