concurrent_hash_map のデフォルトの HashCompare。
template<typename Key> struct tbb_hash_compare;
#include "tbb/concurrent_hash_map.h"
tbb_hash_compare<Key> は、concurrent_hash_map テンプレート・クラスの HashCompare 引数のデフォルトです。 メンバーの説明で示すように、ビルトインの定義は operator== と tbb_hasher に依存します。 独自の型で、tbb_hash_compare テンプレートの特殊化または 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 Key>
struct tbb_hash_compare {
static size_t hash(const Key& a) {
return tbb_hasher(a);
}
static bool equal(const Key& a, const Key& b) {
return a==b;
}
};
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>& );
};