Compartir a través de


operator!= (<deque>)

Tests if the deque object on the left side of the operator is not 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 objects are not equal; false if the deque objects are equal.

Remarks

The comparison between deque objects is based on a pairwise comparison of their elements. Two deque objects are equal if they have the same number of elements and their respective elements have the same values. Otherwise, they are unequal.

Example

// deque_op_ne.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( ) 
{
   using namespace std; 
   deque <int> c1, c2;

   c1.push_back( 1 );
   c2.push_back( 2 );

   if ( c1 != c2 )
      cout << "The deques are not equal." << endl;
   else
      cout << "The deques are equal." << endl;
}

Output

The deques are not equal.

Requirements

Header: <deque>

Namespace: std

See Also

Concepts

<deque> Members

Standard Template Library