operator> (<deque>)

Tests if the deque object on the left side of the operator is greater than the deque object on the right side.

bool operator>(
   const deque<Type, Allocator>& _Left,
   const deque<Type, Allocator>& _Right
);

Parameters

  • _Left
    An object of type deque.

  • _Right
    An object of type deque.

Return Value

true if the deque on the left side of the operator is greater than the deque on the right side of the operator; otherwise false.

Remarks

The comparison between deque objects is based on a pairwise comparison of their elements. The greater-than relationship between two objects is based on a comparison of the first pair of unequal elements.

Example

// 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;
}

Output

Deque c1 is greater than deque c2.

Requirements

Header: <deque>

Namespace: std

See Also

Concepts

<deque> Members

Standard Template Library