ktprime / emhash

Fast and memory efficient c++ flat hash map/set
MIT License
511 stars 35 forks source link

Problem in try_emplace #17

Closed hitdshu closed 2 years ago

hitdshu commented 2 years ago

Hi,

Very excellent project.

https://github.com/ktprime/emhash/blob/master/hash_table7.hpp#L1156

I think in hash_table7, the return value is wrong. Instead of return do_insert().first, one might just return do_insert(); I.e., the code return do_insert(key, std::forward(args)...).first; might need to be changed to return do_insert(key, std::forward(args)...);

Deshun

ktprime commented 2 years ago

It's a issue and fixed now.