Export (0) Print
Expand All

unordered_map::hasher

The type of the hash function.

typedef Hash hasher;

The type is a synonym for the template parameter 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); 
    } 
 
hfn('a') == 1630279
hfn('b') == 1647086

Header: <unordered_map>

Namespace: std

Show:
© 2015 Microsoft