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

Created on 2023-02-13.00:00:00 last changed 21 months ago

Messages

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.

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