The default operator <=> performs lexicographical comparison starting the base classes left to right and using the non-static members in declaration order. Here is a quite sophisticated example from the Microsoft blog: Simplify Your Code with Rocket Science: C++ 20’s Spaceship Operator. struct Basics { int i; char c; float f; double d; auto operator<=>(const Basics&) const = default; }; struct Arr