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

3932. Expression-equivalence is sometimes unimplementable when passing prvalue expressions to comparison CPOs

Section: 17.11.6 [cmp.alg] Status: New Submitter: Jiang An Opened: 2023-05-04 Last modified: 2023-05-24

Priority: 3

View other active issues in [cmp.alg].

View all other issues in [cmp.alg].

View all issues with New status.


Currently, comparison CPOs may call ADL-found strong_order, weak_order, and partial_order functions. It might be impossible to meet the expression-equivalent requirement if one passed argument is a prvalue and an ADL-found function is selected, because temporary materialization must take place before entering the CPO's operator().

Perhaps we should say when E or F is a prvalue expression of an object type, temporary materialization takes place first, and then an xvalue referring to the temporary object is used instead of the original E or F.

There is currently implementation divergence in these CPOs: when performing internal comparison, libstdc++ and libc++ perfect-forward arguments, while MSVC STL always treats arguments as lvalues.

[2023-05-24; Reflector poll]

Set priority to 3 after reflector poll.

Proposed resolution: