This topic has not yet been rated - Rate this topic

operator== (<deque>)

Tests if the deque object on the left side of the operator is 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 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. Two deques are equal if they have the same number of elements and their respective elements have the same values. Otherwise, they are unequal.

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

Header: <deque>

Namespace: std

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.