Open arjen-Lee1993 opened 1 year ago
Hi @arjen-Lee1993. update_fn
can only provide mapped_type&
, as that is the only information stored in the hashtable. If the additional parameters are coming from somewhere else, maybe they can be captured by the lambda you provide to update_fn
? E.g.
map.update_fn(k, [¶m1, ¶m2, &fn](mapped_type& m) { fn(m, param1, param2); });
there are several threads concurrently writing on a same value in the hashmap,so i need "update_fn" rather than "update" to lock the value to avoid overwriting. my input function seems like void fn(mapped_type&, param1 xx, param2 xx ....)
i need more extra input params, but the update_fn may not supported. can u give me some advices to solve this problem?