[libcxx-commits] [libcxx] [libc++] __key_equiv is sometimes unused, sometimes 2x expensive (PR #175087)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 9 00:26:25 PST 2026


================
@@ -1137,9 +1137,9 @@ class flat_map {
 
   struct __key_equiv {
----------------
frederick-vs-ja wrote:

It's a bit unfortunate that usages of `ranges::unique` is no longer pedantically correct due to [[alg.unique]/9.2.1](https://eel.is/c++draft/alg.unique#9.2.1) - `ranges::unique` expects the comparator to express an equivalence relation.

I _think_ we should use some other another algorithm. It seems that potential future refactoring of `ranges::unique` can break the current strategy.

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


More information about the libcxx-commits mailing list