unordered_set::hasher

The type of the hash function.

typedef Hash hasher;

Remarks

The type is a synonym for the template parameter Hash.

Example

 

// std_tr1__unordered_set__unordered_set_hasher.cpp 
// compile with: /EHsc 
#include <unordered_set> 
#include <iostream> 
 
typedef std::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

Requirements

Header: <unordered_set>

Namespace: std

See Also

Reference

<unordered_set>

unordered_set Class

Other Resources

<unordered_set> Members