c++ - How to search hash_map containing reference_wrapper? -
i'm using intel tbb concurrent hash map tbb::hash_map<std::string, std::reference_wrapper<clusters>>
, want search hash_map using
tbb::concurrent_hash_map<std::string, std::reference_wrapper<clusters>>::accessor a; if(table.find(a, operation.get().getkey())) { a->second.get().addoperation(operation); }
but gives error: no matching function call ‘std::reference_wrapper<clusters>::reference_wrapper()
. problem reference_wrapper
has no default constructor find
needs. there way can circumvent this?
it seems bug in implementation of find()
or documentation. either needs mapped type defaultconstructible
when shouldn't, or doesn't document needs this.
i don't think can fix. workaround, store pointers in map instead of reference wrappers.
Comments
Post a Comment