The std::map::value_comp() is a function in C++ STL. It returns a function object that compares objects of type std::map::value.
value_compare value_comp() const
Parameters: It does not accept any parameters.
Returns: This method returns a function object that compares objects of type std::map::value.
Time Complexity: O(1)
Below examples illustrate the map::value_comp() method:
Map contains following elements a = 1 b = 2 c = 3 d = 4 e = 5
Map contains following elements a = A b = B c = C d = D e = E
- Find the number of p-sided squares in a grid with K blacks painted
- C++ program to compare two Strings using Operator Overloading
- not1 and not2 function templates in C++ STL with Examples
- Go vs C++
- Trie Data Structure using smart pointer and OOP in C++
- Minimum Bitwise XOR operations to make any two array elements equal
- std::hash class in C++ STL
- History of C++
- What are Forward declarations in C++
- __builtin_inf() functions of GCC compiler
- Structures in C++
- Variables in C++
- Implementing Forward Iterator in BST
- Count substrings that contain all vowels | SET 2
- Machine Learning in 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 firstname.lastname@example.org. 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.