Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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
);

_Left

An object of type deque.

_Right

An object of type deque.

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.

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;
}
Deque c1 is greater than deque c2.

Requirements

Header: <deque>

Namespace: std

Show: