tbb_hash_compare Class


Hash support class to use with associative containers provided by Intel® Threading Building Blocks (Intel® TBB).


template<typename Key> struct tbb_hash_compare;


A tbb_hash_compare<Key> is the default for the HashCompare argument of template class concurrent_hash_map. For your own types, you can define template specializations of tbb_hash_compare

There are built-in definitions of tbb_hash_compare for the following Key types:

  • Types that are convertible to a size_t by static_cast<T>

  • Pointer types

  • std::basic_string

  • std::pair<K1,K2> where K1 and K2 are hashed using tbb_hasher.


namespace tbb {
    template<typename Key>
    struct tbb_hash_compare {
        static size_t hash(const Key& k) {
            /*implementation defined*/
        static bool equal(const Key& k1, const Key& k2) {
            return k1==k2;
For more complete information about compiler optimizations, see our Optimization Notice.