Why default three-way operator (spaceship ) generates equality operator (==) and user define three-way operator not?
The principle reason why equality and ordering are separated is performance. If you have a type whose ordering operations are user-defined, then more often than not, you can write a user-defined equality test operation that is more efficient at doing equality tests. And therefore, the language should encourage you to write it by not using … Read more