unordered-set

tr1::hash for boost::thread::id?

Dear all: I started to use the unordered_set class from the tr1 namespace to speed-up access against the plain (tree-based) STL map. However, I wanted to store references to threads ID in boost (boost::thread::id), and realized that the API of those identifiers is so opaque that you cannot clearly obtain a hash of it. Surprisingly, boo...

C++ a NULL pointer in the STL container

Hello! I am, unfortunately, not working on a program developed by myself fully. I recently I noticed a Visual Studio Fatal Error on operator-- of unordered_set, which was called from simple insertion of a pointer to unordered_set. After reviewing the locals, I've noticed that set only has 2 elements last of which is NULL (so I suppose ...

Searching std::unordered_set by hash value and predicate

How can I search a std::unordered_set knowing hash value and having some predicate object? (The predicate determining equivalence by pred(x) && pred(y) meaning x == y.) ...

Passing a boost::unordered_set as the result map to boost::split

Does anyone know if it's kosher to pass a boost::unordered_set as the first parameter to boost::split? Under libboost1.42-dev, this seems to cause problems. Here's a small example program that causes the problem, call it test-split.cc: #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/split.hpp> #in...

Preventing keys of different hash values from landing in same bucket with unordered_set

This might be a silly question, but here goes : I hashed a dictionary of words into an unordered_set based hash-table. My hash function was made intentionally "bad", in that all strings that contained the same set of letters would hash to the same value. I initially tried to over-ride the normal hash function behaviour, and use a "freq...