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
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- div() function in C++
- log() function in C++
- exp() function C++
- fma() function in C++
- p5.js | arc() Function
- fegetexceptflag() function in C/C++
- wmemcpy() function in C/C++
- wctrans() function in C/C++
- fegetenv() function in C/C++
- p5.js | triangle() Function
- clock() function in C/C++
- nearbyint() function in C++
- p5.js | ellipse() Function
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.