Created on 2026-06-29.00:00:00 last changed 2 days ago
Possible resolution:
Change in 11.10.3 [class.spaceship] bullet 2.1 as follows:
Let R be the declared return type of a defaulted three-way comparison operator function, and let xi be the elements of the expanded list of subobjects for an object x of type C.
- If R is auto, then let cv i Ri be the type of the expression xi <=> xi . The operator function is defined as deleted if that expression is not usable or if Ri is not a comparison category type (17.12.2.1 [cmp.categories.pre]) for any i.
TheOtherwise, the return type is deduced as the common comparison type (see below) of R0, R1, ..., Rn-1.- ...
Consider:
struct A { friend int operator<=>(A,A); };
struct B { A a; friend auto operator<=>(const B&) const = default; };
using Q = [: return_type_of(^^B::operator<=>) :];
What is the type Q?
Traditionally, CWG had the viewpoint that querying properties of deleted functions (e.g. triviality) should be impossible or ill-formed.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-06-29 19:53:33 | admin | set | messages: + msg8621 |
| 2026-06-29 00:00:00 | admin | create | |