unordered_map::hasher

哈希函数的类型。

typedef Hash hasher;

备注

类型是的同义词。Hash模板参数

示例

 

// std_tr1__unordered_map__unordered_map_hasher.cpp 
// compile with: /EHsc 
#include <unordered_map> 
#include <iostream> 
 
typedef std::unordered_map<char, int> Mymap; 
int main() 
    { 
    Mymap c1; 
 
    Mymap::hasher hfn = c1.hash_function(); 
    std::cout << "hfn('a') == " << hfn('a') << std::endl; 
    std::cout << "hfn('b') == " << hfn('b') << std::endl; 
 
    return (0); 
    } 
 
  

要求

标头: <unordered_map>

命名空间: std

请参见

参考

<unordered_map>

unordered_map 类

其他资源

unordered_map 成员