Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
operator<=
Collapse the table of content
Expand the table of content

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

_Left

An object of type deque.

_Right

An object of type deque.

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.

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.

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

Header: <deque>

Namespace: std

Show:
© 2015 Microsoft