Can Enums be integral types?

Era Scarecrow rtcvb32 at yahoo.com
Tue Apr 19 15:45:07 UTC 2022


On Tuesday, 19 April 2022 at 13:20:21 UTC, Bastiaan Veelo wrote:
> There is nothing that requires enum values to be unique, though:
> ```d
> import std;
> void main()
> {
>     enum E {Zero = 0, One = 0, Two = 0}
>     writeln(E.Two); // Zero!
> }
> ```

  True, but if you want it be useful they really need to be unique.


More information about the Digitalmars-d-learn mailing list