Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator==,!=,<,<=,>,>=,<=>(std::queue)

      From cppreference.com
      <cpp‎ |container‎ |queue

      [edit template]
       
       
       
       
      template<class T,class Container>

      bool operator==(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (1)
      template<class T,class Container>

      bool operator!=(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (2)
      template<class T,class Container>

      bool operator<(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (3)
      template<class T,class Container>

      bool operator<=(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (4)
      template<class T,class Container>

      bool operator>(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (5)
      template<class T,class Container>

      bool operator>=(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (6)
      template<class T,std::three_way_comparable Container>

      std::compare_three_way_result_t<Container>
          operator<=>(conststd::queue<T, Container>& lhs,

                       conststd::queue<T, Container>& rhs);
      (7)(since C++20)

      Compares the contents of the underlying containers of two container adaptors. The comparison is done by applying the corresponding operator to the underlying containers.

      Contents

      [edit]Parameters

      lhs, rhs - container adaptors whose contents to compare
      -
      T must meet the requirements ofEqualityComparable.

      [edit]Return value

      1-6)true if the corresponding comparison yieldstrue,false otherwise.
      7) Result of three-way comparison on underlying containers.

      [edit]Complexity

      Linear in the size of the container.

      [edit]Example

      This section is incomplete
      Reason: no example

      Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 410C++98the semantics of operators!=,>,<= and>= were missingadded
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/queue/operator_cmp&oldid=161983"

      [8]ページ先頭

      ©2009-2025 Movatter.jp