https://issues.dlang.org/show_bug.cgi?id=17418

Jonathan M Davis <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
                   |                            |m

--- Comment #1 from Jonathan M Davis <[email protected]> ---
I would point out that the return values don't need to be spcecific numbers.
They only need to be < 0, == 0, or > 0. And requiring them to be -1, 0, and +1
would be less efficient in a number of cases. Now, looking over that page, I
agree that it's not as clear as it should be, and the problem seems to be that
it's focused on how the compiler is going to take the return value and use that
to generate the correct code for the comparison rather than what the programmer
needs to do with opCmp to make it work correctly. But from the perspective of
the person writing opCmp, opCmp should return a value < 0 if lhs < rhs, 0 if
lhs == rhs, and a value > 0 if lhs > rhs.

--

Reply via email to