unordered_map::key_eq() is a built-in function in C++ STL which returns a boolean value according to the comparison. It depends on the key equivalence comparison predicate used by the unordered_map container. The key equivalence comparison is a predicate which takes two arguments and returns a boolean value indicating whether they are to be considered equivalent. It returns true if they are equivalent else it returns false. It is adopted by the container on construction and is similar to the (==) operator used in the comparison.
Parameter: The function accepts two mandatory parameters args1 and args2, between whom the comparison is to be done. The data_type is same as that of the unordered_map.
Return Value: The function returns a boolean value.
Below programs illustrate the unordered_map::key_eq() function.
GEEKS and geeks are treated dissimilarly in the container
100 and 200 are treated dissimilarly in the container 100 and 100 are treated similarly in the container
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- How to call some function before main() function in C++?
- Function Overloading vs Function Overriding in C++
- How to call function within function in C or C++
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- fma() function in C++
- log() function in C++
- exp() function C++
- div() function in C++
- p5.js | arc() Function
- fegetenv() function in C/C++
- wctrans() function in C/C++
- wmemcpy() function in C/C++
- nearbyint() function in C++
- clock() function in C/C++
- isfinite() function in C++
- wmemchr() function in C/C++
- wcrtomb() function in C/C++
- vswprintf() function in C/C++
- wmemcmp() function in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.