You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be nice for me, I am wrapping the textbook example class - a matrix. For this, less-than or greater-than doesn't make any sense unless we do so in an explicit manner. However, equating two matrices is a very common operation.
Also, might be mnice to add the new spaceship operator too.
I don't think there's anything saying that it would be undefined behaviour if a != b was not equivalent to !(a == b), is there? It could be that a class implements inequality slightly differently from equality. I'd be tempted to use a concept (or equivalent) to check if != is already defined, and only fall back to negating == if that isn't the case, as it's a sensible thing to do.
Edit: I see now it's comparing mathematically, i.e. neither a < b nor b < a, although I still think it might be advantageous to provide for a number of ways to go about htis, as different skills will be required for different use-cases.
You provide Comparable that offers both equality and relational operators, but no skills class that only provides equality.
The text was updated successfully, but these errors were encountered: