Title
Expression-equivalence is sometimes unimplementable when passing prvalue expressions to comparison CPOs
Status
new
Section
[cmp.alg]
Submitter
Jiang An

Created on 2023-05-04.00:00:00 last changed 19 months ago

Messages

Date: 2023-05-15.00:00:00

[ 2023-05-24; Reflector poll ]

Set priority to 3 after reflector poll.

Date: 2023-05-04.00:00:00

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.

History
Date User Action Args
2023-05-24 14:33:00adminsetmessages: + msg13579
2023-05-04 00:00:00admincreate