Avoid comparing elements with operator== multiple times by replacing uses of find and equal_range with equivalent inlined code that uses operator== instead of the container's equality comparison predicate. This is valid because the standard requires that operator== is a refinement of the equality predicate. Also replace the _S_is_permutation function with std::is_permutation, which wasn't yet implemented when this code was first written. PR libstdc++/91263 * include/bits/hashtable.h (_Hashtable<>): Make _Equality<> friend. * include/bits/hashtable_policy.h: Include <bits/stl_algo.h>. (_Equality_base): Remove. (_Equality<>::_M_equal): Review implementation. Use std::is_permutation. * testsuite/23_containers/unordered_multiset/operators/1.cc (Hash, Equal, test02, test03): New. * testsuite/23_containers/unordered_set/operators/1.cc (Hash, Equal, test02, test03): New.
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| allocator | Loading commit data... | |
| buckets | Loading commit data... | |
| cons | Loading commit data... | |
| debug | Loading commit data... | |
| erase | Loading commit data... | |
| hash_policy | Loading commit data... | |
| insert | Loading commit data... | |
| max_load_factor | Loading commit data... | |
| modifiers | Loading commit data... | |
| operations | Loading commit data... | |
| operators | Loading commit data... | |
| requirements | Loading commit data... | |
| 48101-2_neg.cc | Loading commit data... | |
| 48101-3_neg.cc | Loading commit data... | |
| 48101_neg.cc | Loading commit data... | |
| 55043.cc | Loading commit data... | |
| 56267-2.cc | Loading commit data... | |
| 56267.cc | Loading commit data... | |
| 56278.cc | Loading commit data... | |
| 61143.cc | Loading commit data... | |
| 63456.cc | Loading commit data... | |
| 85965.cc | Loading commit data... | |
| 92124.cc | Loading commit data... | |
| erasure.cc | Loading commit data... | |
| final_hash.cc | Loading commit data... | |
| init-list.cc | Loading commit data... | |
| instantiation_neg.cc | Loading commit data... | |
| observers.cc | Loading commit data... | |
| pmr_typedefs.cc | Loading commit data... | |
| pmr_typedefs_debug.cc | Loading commit data... | |
| range_access.cc | Loading commit data... |