[libcxx-commits] [libcxx] [libc++] Optimize most of the __tree search algorithms (PR #155245)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 29 02:47:29 PDT 2025


================
@@ -2030,10 +2035,12 @@ template <class _Key>
 typename __tree<_Tp, _Compare, _Allocator>::size_type
 __tree<_Tp, _Compare, _Allocator>::__count_unique(const _Key& __k) const {
   __node_pointer __rt = __root();
+  auto __comp = __three_way_comparator<value_compare, _Key, value_type>(value_comp());
----------------
philnik777 wrote:

It turns out that we have something quite similar called `__synth_three_way`. I went for `__lazy_synth_three_way_comparator` for now. It's still not quite right, but probably close enough. `__maybe_lazy_potentially_synthesized_three_way_comparator` seems a bit long.

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


More information about the libcxx-commits mailing list