Equality operator chaining?

bearophile bearophileHUGS at lycos.com
Sun Nov 10 11:32:52 PST 2013


Øivind:

> Although GCC accepts the code, I don't think it does what you 
> think here. It will basically z will be compared with '1', 
> which is the value of (4 == 4), and b will become 0, or false.

OK, so it's like in the chained < comparisons.

So I presume D disallows the chained equality for the same 
reasons it disallows the chained < comparisons.

Bye,
bearophile


More information about the Digitalmars-d mailing list