Created on 2019-08-14.00:00:00 last changed 7 months ago
Proposed resolution (October, 2019):
Change 11.10.3 [class.spaceship] paragraph 3 as follows:
...If no such index exists, V is std::strong_ordering::equal
converted to R.
[Adopted as a DR at the November, 2019 meeting.]
According to 11.10.3 [class.spaceship] paragraph 3,
The return value V of type R of the defaulted three-way comparison operator function with parameters x and y of the same type is determined by comparing corresponding elements xi and yi in the expanded lists of subobjects for x and y (in increasing index order) until the first index i where the synthesized three-way comparison for comparison category type R between xi and yi yields a result value vi where vi != 0, contextually converted to bool, yields true; V is vi converted to R. If no such index exists, V is std::strong_ordering::equal converted to R.
This is meaningless, however, because the kind of conversion is not specified. According to bullet 1.1,
If overload resolution for a <=> b finds a usable function (12.2 [over.match]), static_cast<R>(a <=> b).
so consistency would suggest that static_cast<R>(std::strong_ordering::equal) is probably the right answer.
|2020-12-15 00:00:00||admin||set||messages: + msg6470|