Deprecate implicit `int` to `bool` conversion for integer literals

Ola Fosheim Grøstad ola.fosheim.grostad+dlang at gmail.com
Sun Nov 12 16:00:28 UTC 2017


On Sunday, 12 November 2017 at 13:34:50 UTC, Dmitry Olshansky 
wrote:
> if (a & (flag1 | flag2))
>
> to
>
> if ((a & (flag1 | flag2)) != 0)
>
> When the first is quite obvious.

Just change the typing of the if-conditional to:

if (boolean|integral) {…}



More information about the Digitalmars-d mailing list