The multimap::value_comp() method returns a comparison object that can be used to compare two elements to get whether the key of the first one goes before the second. Here the 1st object compares the object of type std::multimap::type. The arguments taken by this function object are of member type type. It is defined in multimap as an alias of pair.
multimap::compared_value value_comp() const;
Here compared_value is a nested class type
Parameters: It does not accepts any parameter.
Return Value: This method returns the comparison object which is an object of the member type multimap::compared_value, which is a nested class that uses the internal comparison object to generate the appropriate comparison functional class.
Below program illustrate the multimap value_comp() function:
a = 10 b = 20 c = 30 d = 40
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.
- multimap::crbegin() and multimap::crend() in C++ STL
- multimap::cbegin() and multimap::cend() in C++ STL
- multimap::begin() and multimap::end() in C++ STL
- multimap size() function in C++ STL
- multimap lower_bound() function in C++ STL
- multimap swap() function in C++ STL
- multimap upper_bound() function in C++ STL
- multimap clear() function in C++ STL
- multimap empty() function in C++ STL
- multimap get_allocator() function in C++ STL
- Descending order in Map and Multimap of C++ STL
- Multimap in C++ Standard Template Library (STL)
- multimap::operator= in C++ STL
- multimap::swap() in C++ STL
- multimap::emplace_hint() in C++ STL
- multimap find() in C++ STL
- multimap::erase() in C++ STL
- multimap::emplace() in C++ STL
- multimap::count() in C++ STL
- multimap equal_range() in C++ STL
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.