[libcxx-commits] [libcxx] [libc++] Only make comparators transparent in __tree if they don't cause a conversion (PR #179453)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 9 06:31:44 PST 2026


================
@@ -1811,8 +1811,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const _Key& __v) {
   }
 
   __node_base_pointer* __node_ptr = __root_ptr();
-  auto&& __transparent            = std::__as_transparent(value_comp());
-  auto __comp = __lazy_synth_three_way_comparator<__make_transparent_t<_Compare>, _Key, value_type>(__transparent);
+  auto&& __transparent            = std::__as_transparent<_Key>(value_comp());
----------------
philnik777 wrote:

We're currently instantiating strings, even for `map["test"]`. I'll definitely try to fix it, but I'd rather not block this patch on a fix for an optimization.

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


More information about the libcxx-commits mailing list