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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 4 06:36:17 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());
----------------
ldionne wrote:

If I understand correctly, as-is this patch turns off using a transparent comparator for e.g. `std::map<std::string, int>::find(std::string_view)`. Is that correct? If so, doesn't that defeat the purpose of the optimization we had added in the first place?

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


More information about the libcxx-commits mailing list