Three-way comparison requiring strong ordering for floating-point types, take 2
11.10.3 [class.spaceship]
Richard Smith

Created on 2023-02-13.00:00:00 last changed 3 weeks ago


Date: 2023-03-03.20:56:48

Suggested resolution:

Change in 11.10.3 [class.spaceship] paragraph 1 as follows:

The synthesized three-way comparison of type R (17.11.2 [cmp.categories]) of glvalues a and b of the same type is defined as follows:
  • If a <=> b is usable (11.10.1 [class.compare.default]) and can be explicitly converted to R using static_cast, static_cast<R>(a <=> b).
  • Otherwise, if a <=> b is usable or overload resolution for a <=> b is performed and finds at least one viable candidate, the synthesized three-way comparison is not defined.
  • Otherwise, ...
Date: 2023-02-13.00:00:00

The resolution accepted for issue 2539 does not actually address the example in the issue, because overload resolution is never performed for expressions involved only built-in types.

Date User Action Args
2023-03-03 20:56:48adminsetmessages: + msg7215
2023-02-13 00:00:00admincreate