[libcxx-commits] [libcxx] [libc++] Add another const_cast to support hash_map copy assignment (PR #188660)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Sat Mar 28 17:38:12 PDT 2026


https://github.com/philnik777 commented:

IMO we should revert this.

This patch has two problems:
1) We now accept copy assignment of a `unordered_set<pair<const int, int>>`, which may be conforming, but I don't think is a good idea - why is pair special?, and
2) significantly regresses performance for e.g. `unordered_map<string, int>` move assignment with different allocators, since we don't move the key anymore: https://godbolt.org/z/Ta4sv4Tjr (line 173 in trunk calls the string copy constructor instead of moving).

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


More information about the libcxx-commits mailing list