unordered_set::hash_function
更新 : 2007 年 11 月
格納されているハッシュ関数オブジェクトを取得します。
Hash hash_function() const;
解説
このメンバ関数は、格納されているハッシュ関数オブジェクトを返します。
使用例
// std_tr1__unordered_set__unordered_set_hash_function.cpp
// compile with: /EHsc
#include <unordered_set>
#include <iostream>
typedef std::tr1::unordered_set<char> Myset;
int main()
{
Myset c1;
Myset::hasher hfn = c1.hash_function();
std::cout << "hfn('a') == " << hfn('a') << std::endl;
std::cout << "hfn('b') == " << hfn('b') << std::endl;
return (0);
}
hfn('a') == 1630279
hfn('b') == 1647086
必要条件
ヘッダー : <unordered_set>
名前空間 : std::tr1