efficient / libcuckoo

A high-performance, concurrent hash table
Other
1.62k stars 275 forks source link

Why does `insert_or_assign` require the value to be CopyAssignable? #153

Closed yilongli closed 1 year ago

yilongli commented 1 year ago

This prevents me from calling insert_or_assign when the value type is a unique_ptr.

cuckoohash_map<int, unique_ptr<Foo>> map;
map.insert_or_assign(1, std::make_unique<Foo>());

Right now, I have to work around this by calling upsert directly with my own functor.

Thanks!

manugoyal commented 1 year ago

Thanks for flagging this @yilongli! Just an oversight, corrected in e1d749174b550bd534cb96e4e82acb144c4ff3dc.