- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to use concurrent hash map with the key type being "const char*", like, concurrent_hash_map
I make sure that the pointer to the key is not destroyed so long as the hash key is not erased from the map. MyHashCompare hash function hashes the null terminated string pointed to by the key pointer.
The problem I am facing is that my lookup is always failing. It appears that the hsah_map is looking up the actual pointer instead of hashing on the key value.
This works on std::hash_map. I know I can change it so that the key values are std::strings, but want to avoid construction/destruction and copying.
I am using the version tbb20_20080408oss_src.
Appreciate any help.
Thanks
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for stating the obvious, but you only mention MyHashCompare::hash(), and not its equal() function: does it use == or !strcmp()?
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