Overloading the Spaceship Operator, A Recipe

Open link in next tab

C++: Overloading the Spaceship Operator, A Recipe

https://indii.org/blog/overloading-the-spaceship-operator/

How to overload the three-way comparison (spaceship) `operator<=>`, and a reminder to overload `operator==` as well.

C++: Overloading the Spaceship Operator, A Recipe

The spaceship operator took me longer than it should (my mistake). A note to my future self, and maybe of use to you.