Added finalizer to default hash function.#78
Added finalizer to default hash function.#78stgatilov wants to merge 3 commits intoTessil:masterfrom
Conversation
…unction on uint64_t. It constructs a set of distinct keys with zero lower half, then computes hash function for all of them, and checks that the hashes are mostly different in lower bits.
…ibstd-c++ or libc++ is used.
|
Thanks for the contribution. The change looks good but I'm a bit worried about the backward compatibility and the risk of changing the performance of existing users. We're applying the finalizer by default no matter the type of I wonder if we should instead provide the |
|
Finalizer is not applied on MSVC, i.e. it is only applied on libstd-c++ and libc++. In my opinion, if you don't enable finalizer by default and keep default size policy as "power of two", then it is incorrect to say that tsl map is drop-in replacement for std::unordered_map (or other hash map implementations) and that no expertise is required to use it. And you should certainly static_assert against using pointers as keys then, because this is the case where this issue almost always happens. If you have some specific benchmarks in mind, I can run them. |
See #73