[libcxx-commits] [libcxx] [libc++] Avoid constructing additional objects when using map::at (PR #157866)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 17 09:04:02 PDT 2025


================
@@ -2538,6 +2540,26 @@ struct __default_three_way_comparator<basic_string<_CharT, _Traits, _Alloc>, bas
 };
 #  endif
 
+template <class _Comparator, class _CharT, class _Traits, class _Alloc>
+inline const bool __is_transparently_comparable_v<
+    _Comparator,
+    basic_string<_CharT, _Traits, _Alloc>,
+    const _CharT*,
+    __enable_if_t<__desugars_to_v<__potentially_transparent_comp_tag,
+                                  _Comparator,
+                                  const basic_string<_CharT, _Traits, _Alloc>&,
+                                  const basic_string<_CharT, _Traits, _Alloc>&>>> = true;
----------------
ldionne wrote:

```suggestion
    __enable_if_t<__is_generic_transparent_comparator_v<_Comparator>>> = true;
```


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


More information about the libcxx-commits mailing list