Is -1 > 7 ?

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Aug 9 09:28:38 PDT 2013


On 8/9/13, Manfred Nowak <svv1999 at hotmail.com> wrote:
> michaelc37 wrote:
>> WTF -> -1 is greater than 7 ????
>
> From the docs:
>
> It is an error to have one operand be signed and the other unsigned for a
> <, <=, > or >= expression.
>
> -manfred
>

Chances are generic code would break, so maybe that part of the docs
should be removed. I've already tried implementing something related
to comparisons like this but it did end up breaking code:
https://github.com/D-Programming-Language/dmd/pull/1337


More information about the Digitalmars-d-learn mailing list