std::flat_m...lue_compare(3)
π
std::flat_map::value_compare π
okay bestie, this is the std::flat_m...lue_compare(3) page from the C++ Standard Libary β full name std::flat_map::value_compare, and it's literally the tiny function-object baddie that compares your flat_map pairs. π¦
β¨ NAME β¨
std::flat_map::value_compare β std::flat_map::value_compare.
πΈ Synopsis πΈ
class value_compare; (since C++23)
std::flat_map::value_compare is a function object that compares objects of type std::flat_map::const_reference (a pair of references to the stored key/value) by comparing the first components (i.e. keys) of the passed pairs. periodt.
π Member objects π
comp(private) β the comparison function object of typestd::flat_map::key_compare(exposition-only member object*).
π Member functions π
constructorβ constructs avalue_compareobject, marked(private)and also listed as a(public member function). iykyk.operator()β compares two values of typevalue_type(public member function).
π§ std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::value_compare::value_compare π§
this one is private: and exposition only*, bestie:
private: (exposition only*)
value_compare( key_compare c );
Initializes the underlying instance of the comparator comp to c.
Parameters
cβ a comparator to assign.
π₯ std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::value_compare::operator() π₯
bool operator()( const const_reference& lhs, const const_reference& rhs ) const;
Compares lhs.first and rhs.first by calling the stored comparator comp.
Parameters
lhs,rhsβ values to compare.
Return value
comp(lhs.first, rhs.first)
Exceptions
May throw implementation-defined exceptions.
Signed with sparkles by the C++ Standard Libary girlies, version/date 2024.06.10, source cppreference.com. πβ¨
π¦ 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