[libcxx-commits] [libcxx] [libc++] Avoid key_eq calls in hash_table rehash (PR #216551)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 18 17:57:00 PDT 2026


xbcnn wrote:

> > > I'm somewhat wondering whether we should just try killing the code-path out-right and see how much breaks.
> > 
> > 
> > But the standard currently explicitly requires that the relative order of elements within each equivalent-key group should be preserved (see N4950 [24.2.8.1 9]). And I think this code block is meant just for that. Correct me if I'm wrong.
> 
> Where does it say that? AFAICT that paragraph says rather the opposite: "Rehashing invalidates iterators, changes ordering between elements, and changes which buckets elements appear in"

The last sentence: "[For unordered_multiset and unordered_multimap, rehashing preserves the relative ordering of equivalent elements.](https://timsong-cpp.github.io/cppwp/n4950/unord.req.general#9.sentence-5)"


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


More information about the libcxx-commits mailing list