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

non-defaulted operator doesn’t generate == and != in C++20

This is by design. [class.compare.default] (emphasis mine) 3 If the class definition does not explicitly declare an == operator function, but declares a defaulted three-way comparison operator function, an == operator function is declared implicitly with the same access as the three-way comparison operator function. The implicitly-declared == operator for a class X is an … Read more