On Tue, Jun 13, 2017 at 10:51:40AM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > I think Andrei has a nice way to do opCmp for integers that's a simple > subtraction and negation or something like that. [...]
In theory, cmp(int x, int y) can be implemented simply as (x - y). However, this fails when integer overflow occurs. Does Andrei have a nice way of doing this that isn't vulnerable to integer overflow? T -- You are only young once, but you can stay immature indefinitely. -- azephrahel