Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::value_compare

      From cppreference.com
      <cpp‎ |container‎ |flat map

      [edit template]
       
       
       
      std::flat_map
      Member types
      Member functions
      Non-member functions
      Helper classes
      Tags
      Deduction guides
       
      class value_compare;
      (since C++23)

      std::flat_map::value_compare is a function object that compares objects of typestd::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.

      Contents

      [edit]Member objects

      Member name Definition
      comp(private) the comparison function object of typestd::flat_map::key_compare
      (exposition-only member object*)

      [edit]Member functions

      (constructor)
      (private)
      constructsvalue_compare object
      (public member function)
      operator()
      compares two values of typevalue_type
      (public member function)

      std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::value_compare::value_compare

      private:
      value_compare( key_compare c);
      (exposition only*)

      Initializes the underlying instance of the comparatorcomp toc.

      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;

      Compareslhs.first andrhs.first by calling the stored comparatorcomp.

      Parameters

      lhs, rhs - values to compare

      Return value

      comp(lhs.first, rhs.first)

      [edit]Exceptions

      May throw implementation-defined exceptions.

      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/flat_map/value_compare&oldid=168018"

      [8]ページ先頭

      ©2009-2026 Movatter.jp