std::flat_m...lue_compare(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… 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 type std::flat_map::key_compare (exposition-only member object*).

πŸ’– Member functions πŸ’–

  • constructor β€” constructs a value_compare object, marked (private) and also listed as a (public member function). iykyk.
  • operator() β€” compares two values of type value_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