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
- Modulo Operator (%) in C/C++ with Examples
- fpclassify() method in C/C++ with Examples
- Operator Overloading '<<' and '>>' operator in a linked list class
- How to find the Entry with largest Value in a C++ Map
- Visibility Modes in C++ with Examples
- Speed up Code executions with help of Pragma in C/C++
- Vector of Vectors in C++ STL with Examples
- Array of Vectors in C++ STL
- How to call some function before main() function in C++?
- Difference between Virtual function and Pure virtual function in C++
- cin get() in C++ with Examples
- Difference between Increment and Decrement Operators
- Map of Vectors in C++ STL with Examples
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
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.