DIP 1015--removal of integer & character literal conversion to bool--Final Review

Nicholas Wilson iamthewilsonator at hotmail.com
Mon Sep 17 00:25:48 UTC 2018


On Sunday, 16 September 2018 at 23:59:18 UTC, aliak wrote:
> What about:
>
> enum E: bool {
>     no, yes
> }
>
> void main() {
>     E e = cast(E)(0);
> }
>
> Would be illegal I assume?

You have an explicit cast, so no, it would be fine.





More information about the Digitalmars-d mailing list