C ++ hash table implementation with conflict handling
In addition to the ones mentioned in other answers, you can try MCT closed_hash_map
or linked_hash_map
. It is internally similar to Google SparseHash, but does not limit the values used and has some other functional benefits.
I'm not sure I understand what you mean by "no collision support". Both Google SparseHash and similarly implemented MCTs, of course, handle conflicts perfectly, although they differ from Java HashMap
.
a source to share
Use std :: unordered_map (or unordered_multimap), which despite its name is a hash table - it will be part of the next C ++ standard, and is available in most modern C ++ implementations. Do not use classes with hash
in your names that may be implemented in your implementation - they are not and will not be standard.