Udostępnij za pośrednictwem


operator== (<deque>)

Testy, jeśli obiekt deque po lewej stronie operatora jest równa obiekt deque po prawej stronie.

bool operator==(
   const deque<Type, Allocator>& _Left,
   const deque<Type, Allocator>& _Right
);

Parametry

  • _Left
    Obiekt typu deque.

  • _Right
    Obiekt typu deque.

Wartość zwracana

TRUE , jeśli deque po lewej stronie operatora jest równa deque po prawej stronie operatora; w przeciwnym razie false.

Uwagi

Porównanie między obiektami deque opiera się na parowania porównanie ich elementów.Dwa deques są równe, jeśli mają taką samą liczbę elementów i ich odpowiednich elementów mają te same wartości.W przeciwnym razie są nierówne.

Przykład

// 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;
}
  
  

Wymagania

Nagłówek: <deque>

Obszar nazw: std

Zobacz też

Informacje

deque::operator== i deque::operator<

Standardowa biblioteka szablonu