Namespaces
Variants

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

From cppreference.net

template < class T, class Container >

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

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

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

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

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

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

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

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

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

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

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

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

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

const std:: stack < T, Container > & rhs ) ;
(7) (C++20부터)

두 개의 컨테이너 어댑터의 기반 컨테이너 내용을 비교합니다. 비교는 해당 연산자를 기반 컨테이너에 적용하여 수행됩니다.

목차

매개변수

lhs, rhs - 비교할 컨테이너 어댑터
-
T EqualityComparable 요구 사항을 충족해야 합니다.

반환값

1-6) true 해당 비교 결과가 true 이면, false 그렇지 않으면.
7) 기본 컨테이너에 대한 삼중 비교 결과.

복잡도

컨테이너 크기에 선형적으로 비례합니다.

예제

결함 보고서

다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.

DR 적용 대상 게시된 동작 올바른 동작
LWG 410 C++98 모든 비교 연산자의 의미론이 누락됨 추가됨