Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/container/queue/operator cmp"

From cppreference.com
< cpp‎ | container‎ | queue
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh)
m (langlinks)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
{{page template|cpp/container_adaptor/operator_cmp|queue}}
+
{{page|cpp/container_adaptor/operator_cmp|queue}}
  
[[de:cpp/container/queue/operator cmp]]
+
deesfritjaptruzh
[[es:cpp/container/queue/operator cmp]]
+
[[fr:cpp/container/queue/operator cmp]]
+
[[it:cpp/container/queue/operator cmp]]
+
[[ja:cpp/container/queue/operator cmp]]
+
[[pt:cpp/container/queue/operator cmp]]
+
[[ru:cpp/container/queue/operator cmp]]
+
[[zh:cpp/container/queue/operator cmp]]
+

Latest revision as of 03:21, 4 November 2023

 
 
 
 
template< class T, class Container >

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

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

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

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

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

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

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

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

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

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

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

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

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

                 const std::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 of EqualityComparable.

[edit] Return value

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

[edit] Complexity

Linear in the size of the container.

[edit] Example

Defect reports

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

DR Applied to Behavior as published Correct behavior
LWG 410 C++98 the semantics of operators !=, >, <= and >= were missing added