3 ms·
Generally, no. Most of the time you're going to write these functions as defaulted with an auto return type: auto operator<=>(const T&) const = default;
by slavik81 7y ago
Generally, no. Most of the time you're going to write these functions as defaulted with an auto return type:
auto operator<=>(const T&) const = default;
bool operator==(const T&) const = default;
The compiler will implement the function by comparing all the class member variables and will pick the type of the ordering as appropriate. You only need to look into further details about ordering types if you want to do something fancy.