Share via


unordered_set::key_equal

The type of the comparison function.

typedef Pred key_equal;

Remarks

The type is a synonym for the template parameter Pred.

Example

 

// std_tr1__unordered_set__unordered_set_key_equal.cpp 
// compile with: /EHsc 
#include <unordered_set> 
#include <iostream> 
 
typedef std::tr1::unordered_set<char> Myset; 
int main() 
    { 
    Myset c1; 
 
    Myset::key_equal cmpfn = c1.key_eq(); 
    std::cout << "cmpfn('a', 'a') == " 
        << std::boolalpha << cmpfn('a', 'a') << std::endl; 
    std::cout << "cmpfn('a', 'b') == " 
        << std::boolalpha << cmpfn('a', 'b') << std::endl; 
 
    return (0); 
    } 
 

cmpfn('a', 'a') == true cmpfn('a', 'b') == false

Requirements

Header: <unordered_set>

Namespace: std::tr1

See Also

Reference

<unordered_set>

unordered_set Class