- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using tbb::concurrent_unordered_map to replace std::map in my program like this:
Before: class KvSubTable; typedef std::weak_ptr<KvSubTable> KvSubTableId; std::map<KvSubTableId, int, std::owner_less<KvSubTableId> > mEntryMap;
Now, I use tbb::concurrent_unordered_map to replace std::map , but it has some compile errors:
tbb::concurrent_unordered_map<KvSubTableId, int, tbb::tbb_hash<KvSubTableId>, std::owner_less<KvSubTableId> > mEntryMap;
cpp/ext/amd64/include/tbb/internal/_tbb_hash_compare_impl.h:66:37: error: invalid static_cast from type 'const std::weak_ptr<tianji::master::KvSubTable>' to type 'std::size_t {aka long unsigned int}' 180 return static_cast<size_t>( t ) * internal::hash_multiplier; 181 ^
then, I have try some solutions like this , but it does not work.
template <typename T> inline bool operator==(const std::weak_ptr<T>& t, const std::weak_ptr<T>& u) { return !t.owner_before(u) && !u.owner_before(t); }
So, how can it work, please help....
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page