operator<= (<deque>)

Tests if the deque object on the left side of the operator is less than or equal to 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 less than or equal to 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 less than or equal to relationship between two objects is based on a comparison of the first pair of unequal elements.

Example

// 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.

Requirements

Header: <deque>

Namespace: std

See Also

Reference

Standard Template Library