unordered_set key_seq() in C++

key_seq(): This function is available in the File: unordered_set.h. This function is a build-in function in STL of C++.

Syntax:

std::equal_to<int> std::unordered_set<int>::key_eq() const

This functions returns the key comparison object with which the unordered_set was constructed.

File: unordered_set.h 

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    unordered_set<stringst;

    bool res = st.key_eq()("hello""hello");
    if (res==1)
        cout << "equal\n";
    else
        cout << "not equal\n";

    return 0;
}

Output:

equal

No comments:

Post a Comment