Вы можете использовать потоковую способность:
struct Hasher
{
size_t operator()(const boost::thread::id& id)
{
std::ostringstream os; os << id; return hash(os.str());
}
};
Маленькая выдержка из класса, чтобы другие могли увидеть, что возможно:
class thread::id
{
public:
id();
bool operator==(const id& y) const;
bool operator!=(const id& y) const;
bool operator<(const id& y) const;
bool operator>(const id& y) const;
bool operator<=(const id& y) const;
bool operator>=(const id& y) const;
template<class charT, class traits>
friend std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os, const id& x);
};