Forbidding implicit conversions from an enum type to an integer

Per Nordlöw per.nordlow at gmail.com
Tue Apr 2 09:37:26 UTC 2019


On Tuesday, 2 April 2019 at 09:02:03 UTC, Dennis wrote:
> You can make the enum type not an integer type.
>
> ```
> struct Int{int i;}
>
> enum E: Int {
>     first = Int(0),
>     second = Int(1),
> }
> ```

Thanks.

Are there any plans on deprecating implicit conversions of enums 
to integers?


More information about the Digitalmars-d-learn mailing list