std::map::value_compare(3)
π std::map::value_compare π
Okay bestie, welcome to the C++ Standard Libary manual page for std::map::value_compare β yes, it's giving very specific function-object couture, and we're getting into it. π
πΈ NAME πΈ
std::map::value_compare β std::map::value_compare
β¨ Synopsis β¨
class value_compare;
std::map::value_compare is a function object that compares objects of type std::map::value_type (key-value pairs) by comparing the first components of the pairs.
π Member types π
Type β Definition, bestie:
result_typeβbool(deprecated in C++17)(removed in C++20)first_argument_typeβvalue_type(deprecated in C++17)(removed in C++20)second_argument_typeβvalue_type(deprecated in C++17)(removed in C++20)
These member types are obtained via publicly inheriting (until C++11) std::binary_function<value_type, value_type, bool>.
π§ Protected member objects π§
Compare compβ the stored comparator (protected member object)
π Member functions π
- constructor β constructs a new
value_compareobject (protected member function) operator()β compares two values of typevalue_type(public member function)
π οΈ std::map<Key,T,Compare,Alloc>::value_compare::value_compare π οΈ
protected:
value_compare( Compare c );
Initializes the internal instance of the comparator to c.
πΈ Parameters πΈ
cβ comparator to assign
π¦ std::map<Key,T,Compare,Alloc>::value_compare::operator() π¦
bool operator()( const value_type& lhs, const value_type& rhs ) const;
Compares lhs.first and rhs.first by calling the stored comparator.
πΈ Parameters πΈ
lhs,rhsβ values to compare
π Return value π
comp(lhs.first, rhs.first)
π Exceptions π
May throw implementation-defined exceptions.
That's the whole page, bestie β mwah π. Source: http://cppreference.com Β· version/date: 2024.06.10.
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms