This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

4157. The resolution of LWG3465 was damaged by P2167R3

Section: 17.11.6 [cmp.alg] Status: WP Submitter: Jiang An Opened: 2024-09-18 Last modified: 2024-11-28

Priority: Not Prioritized

View other active issues in [cmp.alg].

View all other issues in [cmp.alg].

View all issues with WP status.

Discussion:

In the resolution of LWG 3465(i), F < E was required to be well-formed and implicitly convertible to bool. However, P2167R3 replaced the convertibility requirements with just "each of decltype(E == F) and decltype(E < F) models boolean-testable", which rendered the type of F < E underconstrained.

[2024-10-02; Reflector poll]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

[Wrocław 2024-11-23; Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4988.

  1. Modify 17.11.6 [cmp.alg] as indicated:

    (6.3) — Otherwise, if the expressions E == F, E < F, and F < E are all well-formed and each of decltype(E == F) and, decltype(E < F) , and decltype(F < E) models boolean-testable,
    
      E == F ? partial_ordering::equivalent :
      E < F  ? partial_ordering::less :
      F < E  ? partial_ordering::greater :
               partial_ordering::unordered
    
    except that E and F are evaluated only once.