martinus / robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
https://gitter.im/martinus/robin-hood-hashing
MIT License
1.5k stars 142 forks source link

Add member functions from C++17 #79

Closed k0zmo closed 4 years ago

k0zmo commented 4 years ago

Adds try_emplace and insert_or_assign from C++17. Fixes #71.

k0zmo commented 4 years ago

How do I please both clang-tidy which wants me to pass the string by value (I agree) and LGTM which wants me to pass the string by const reference?

EDIT: Nevermind

martinus commented 4 years ago

Pleasing all is a pain, but most of the time its possible... Again, thanks a lot!

GilesBathgate commented 3 years ago

@martinus Am I correct in understanding that this implementation does a double hash lookup, i.e the lookup in find() and then if not found a repeat lookup in emplace() could it be improved to do the same but with a single lookup?