다음을 통해 공유


<deque> 연산자

operator!=

연산자의 좌변에 있는 deque 개체가 우변에 있는 deque 개체와 같지 않은지 테스트합니다.

bool operator!=(const deque<Type, Allocator>& left, const deque<Type, Allocator>& right);

매개 변수

left
deque 형식의 개체입니다.

right
deque 형식의 개체입니다.

Return Value

true deque 개체가 같지 않으면 false deque 개체가 같으면 입니다.

설명

deque 개체 간의 비교는 해당 요소의 쌍 비교를 기반으로 합니다. 포함된 요소 수가 같고 개별 요소의 값이 같으면 두 deque 개체는 같은 것입니다. 그렇지 않으면 목록은 같지 않은 것입니다.

예시

// deque_op_ne.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;
   deque <int> c1, c2;

   c1.push_back( 1 );
   c2.push_back( 2 );

   if ( c1 != c2 )
      cout << "The deques are not equal." << endl;
   else
      cout << "The deques are equal." << endl;
}
The deques are not equal.

operator<

연산자의 좌변에 있는 deque 개체가 우변에 있는 deque 개체보다 작은지 테스트합니다.

bool operator<(const deque<Type, Allocator>& left, const deque<Type, Allocator>& right);

매개 변수

left
deque 형식의 개체입니다.

right
deque 형식의 개체입니다.

Return Value

true 연산자의 왼쪽에 있는 deque가 연산자의 오른쪽에 있는 deque보다 작고 같지 않으면 false.

설명

deque 개체 간의 비교는 해당 요소의 쌍 비교를 기반으로 합니다. 두 개체 간의 보다 작음 관계는 같지 않은 요소의 첫 번째 쌍 비교를 기반으로 합니다.

예시

// deque_op_lt.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;
   deque <int> c1, c2;

   c1.push_back( 1 );
   c1.push_back( 2 );
   c1.push_back( 4 );

   c2.push_back( 1 );
   c2.push_back( 3 );

   if ( c1 < c2 )
      cout << "Deque c1 is less than deque c2." << endl;
   else
      cout << "Deque c1 is not less than deque c2." << endl;
}
Deque c1 is less than deque c2.

operator<=

연산자의 좌변에 있는 deque 개체가 우변에 있는 deque 개체보다 작거나 같은지 테스트합니다.

bool operator<=(const deque<Type, Allocator>& left, const deque<Type, Allocator>& right);

매개 변수

left
deque 형식의 개체입니다.

right
deque 형식의 개체입니다.

Return Value

true 연산자의 왼쪽에 있는 deque가 연산자의 오른쪽에 있는 deque보다 작거나 같으면 false.

설명

deque 개체 간의 비교는 해당 요소의 쌍 비교를 기반으로 합니다. 두 개체 간의 작거나 같음 관계는 같지 않은 첫 번째 요소 쌍의 비교를 기반으로 합니다.

예시

// deque_op_le.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;
   deque <int> c1, c2;

   c1.push_back( 1 );
   c1.push_back( 2 );
   c1.push_back( 4 );

   c2.push_back( 1 );
   c2.push_back( 3 );

   if ( c1 <= c2 )
      cout << "Deque c1 is less than or equal to deque c2." << endl;
   else
      cout << "Deque c1 is greater than deque c2." << endl;
}
Deque c1 is less than or equal to deque c2.

연산자==

연산자의 좌변에 있는 deque 개체가 우변에 있는 deque 개체와 같은지 테스트합니다.

bool operator==(const deque<Type, Allocator>& left, const deque<Type, Allocator>& right);

매개 변수

left
deque 형식의 개체입니다.

right
deque 형식의 개체입니다.

Return Value

true 연산자의 왼쪽에 있는 deque가 연산자의 오른쪽에 있는 deque와 같으면 false.

설명

deque 개체 간의 비교는 해당 요소의 쌍 비교를 기반으로 합니다. 포함된 요소 수가 같고 개별 요소의 값이 같으면 두 deque는 같은 것입니다. 그렇지 않으면 목록은 같지 않은 것입니다.

예시

// deque_op_eq.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;
   deque <int> c1, c2;

   c1.push_back( 1 );
   c2.push_back( 1 );

   if ( c1 == c2 )
      cout << "The deques are equal." << endl;
   else
      cout << "The deques are not equal." << endl;

   c1.push_back( 1 );
   if ( c1 == c2 )
      cout << "The deques are equal." << endl;
   else
      cout << "The deques are not equal." << endl;
}
The deques are equal.
The deques are not equal.

operator>

연산자의 좌변에 있는 deque 개체가 우변에 있는 deque 개체보다 큰지 테스트합니다.

bool operator>(const deque<Type, Allocator>& left, const deque<Type, Allocator>& right);

매개 변수

left
deque 형식의 개체입니다.

right
deque 형식의 개체입니다.

Return Value

true 연산자의 왼쪽에 있는 deque가 연산자의 오른쪽에 있는 deque보다 크면 false.

설명

deque 개체 간의 비교는 해당 요소의 쌍 비교를 기반으로 합니다. 두 개체 간의 보다 큼 관계는 같지 않은 요소의 첫 번째 쌍 비교를 기반으로 합니다.

예시

// deque_op_gt.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;
   deque <int> c1, c2;

   c1.push_back( 1 );
   c1.push_back( 3 );
   c1.push_back( 1 );

   c2.push_back( 1 );
   c2.push_back( 2 );
   c2.push_back( 2 );

   if ( c1 > c2 )
      cout << "Deque c1 is greater than deque c2." << endl;
   else
      cout << "Deque c1 is not greater than deque c2." << endl;
}
Deque c1 is greater than deque c2.

operator>=

연산자의 좌변에 있는 deque 개체가 우변에 있는 deque 개체보다 크거나 같은지 테스트합니다.

bool operator>=(const deque<Type, Allocator>& left, const deque<Type, Allocator>& right);

매개 변수

left
deque 형식의 개체입니다.

right
deque 형식의 개체입니다.

Return Value

true 연산자의 왼쪽에 있는 deque가 연산자의 오른쪽에 있는 deque보다 크거나 같으면 false.

설명

deque 개체 간의 비교는 해당 요소의 쌍 비교를 기반으로 합니다. 두 개체 간의 크거나 같음 관계는 같지 않은 첫 번째 요소 쌍의 비교를 기반으로 합니다.

예제

// deque_op_ge.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;
   deque <int> c1, c2;

   c1.push_back( 1 );
   c1.push_back( 3 );
   c1.push_back( 1 );

   c2.push_back( 1 );
   c2.push_back( 2 );
   c2.push_back( 2 );

   if ( c1 >= c2 )
      cout << "Deque c1 is greater than or equal to deque c2." << endl;
   else
      cout << "Deque c1 is less than deque c2." << endl;
}
Deque c1 is greater than or equal to deque c2.