インテル® TBB によって提供される結合コンテナー用のハッシュ・サポート・クラス。
template<typename Key> struct tbb_hash_compare; template<typename Key> struct tbb_hash;
tbb_hash_compare<Key> は、concurrent_hash_map テンプレート・クラスの HashCompare 引数のデフォルトです。tbb_hash<Key> は、concurrent_unordered_[multi]map および concurrent_unordered_[multi]set テンプレート・クラスの Hasher 引数のデフォルトです。メンバーの説明で示すように、ビルトインの定義は operator== と tbb_hasher に依存します。独自の型で、tbb_hash_compare や tbb_hash テンプレートの特殊化、または tbb_hasher のオーバーロードを定義できます。
次の Key 型については、tbb_hasher のビルトインの定義があります。
static_cast<T> で size_t に変換可能な型
ポインター型
std::basic_string
std::pair<K1,K2> (K1 および K2 は tbb_hasher を使用してハッシュされる)
namespace tbb {
template<typename T>
size_t tbb_hasher(const T&);
template<typename T>
size_t tbb_hasher(T*);
template<typename T, typename Traits, typename Alloc>
size_t tbb_hasher(const std::basic_string<T, Traits,Alloc>&);
template<typename T1, typename T2>
size_t tbb_hasher(const std::pair<T1,T2>& );
template<typename Key>
struct tbb_hash_compare {
static size_t hash(const Key& k) {
return tbb_hasher(k);
}
static bool equal(const Key& k1, const Key& k2) {
return k1==k2;
}
};
template<typename Key>
struct tbb_hash {
tbb_hash() {}
size_t operator()(const Key& k) const {
return tbb_hasher(k);
}
};
}