[libcxx-commits] [libcxx] [libc++] Make lazy three way comparator optimization apply in older standard modes (PR #218525)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 01:49:56 PDT 2026


================
@@ -690,7 +689,8 @@ struct __lazy_synth_three_way_comparator<__map_value_compare<_Key, _MapValueT, _
       : __comp_(__comp.key_comp()) {}
 
   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 auto
-  operator()(_LIBCPP_LIFETIMEBOUND const _MapValueT& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const {
+  operator()(_LIBCPP_LIFETIMEBOUND const _MapValueT& __lhs, _LIBCPP_LIFETIMEBOUND const _MapValueT& __rhs) const
+      -> decltype(__comp_(__lhs.first, __rhs.first)) {
----------------
philnik777 wrote:

How does this work in C++03?

Edit: it doesn't.

https://github.com/llvm/llvm-project/pull/218525


More information about the libcxx-commits mailing list