D Logic bug

Trass3r un at known.com
Fri Oct 12 00:43:12 UTC 2018


On Thursday, 11 October 2018 at 14:35:34 UTC, James Japherson 
wrote:
> Took me about an hour to track this one down!
>
> A + (B == 0) ? 0 : C;
>
> D is evaluating it as
>
> (A + (B == 0)) ? 0 : C;

That's why shouldn't compose it like that.
It's been a constant source of bugs in C/C++ code:
https://www.viva64.com/en/b/0583/#ID0E1CAC


More information about the Digitalmars-d mailing list