opCmp with template type not working.

ag0aep6g anonymous at example.com
Tue Nov 3 06:56:45 UTC 2020

On 03.11.20 04:07, user1234 wrote:
> opCmp should return a signed integer. This allows to match well with the 
> x86 flag register and do fast comparison with integers types (in which 
> case just substract rhs to lhs and you're good)

Doing comparison by subtracting is a cute idea, but it doesn't actually 
work in general because of wraparound.

Example: int.min < 1, but int.min - 1 > 0.

More information about the Digitalmars-d mailing list