Three-way comparison (<=>)
operator<=>, defaulted comparisons, rewritten candidates, comparison categories, and library adoption.
Connected features
Papers
13 · Albuquerque 2017 → Prague 2020Adds operator<=>, comparison categories and defaulted comparisons.
Adds <compare> library support for the spaceship operator.
Makes <=> symmetric for rewritten expressions.
Consistency improvements for <=> and other comparison operators.
Separates == from <=>: defaulted <=> implies a defaulted ==, and != is rewritten from ==.
Defines when <=> is used for defaulted comparisons of members without <=>.
Adds <=> across the standard library ('the mothership').
Tunes up spaceship: rewritten candidates and defaulted comparison rules.
Makes <compare> freestanding.
Allows defaulted comparison operators taking parameters by value.
Removes weak_equality and strong_equality.
Cleans up the specification of defaulted comparisons.
Allows defaulting comparison operators outside the class.