Can Enums be integral types?

Manfred Nowak svv1999 at hotmail.com
Sat Apr 16 11:39:01 UTC 2022


In the specs(17) about enums the word "integral" has no match. 
But because the default basetype is `int`, which is an integral 
type, enums might be integral types whenever their basetype is an 
integral type.

On the other hand the specs(7.6.5.3) about types say
| A bool value can be implicitly converted to any integral type,
| with false becoming 0 and true becoming 1.

This seems senseless, when the enum has no names defined for one 
of these values.



More information about the Digitalmars-d-learn mailing list