Share via


operator!= (hash_multimap)

[!NOTA]

Esta API está obsoleta.La alternativa es unordered_multimap Class.

Comprueba si el objeto de hash_multimap en el lado izquierdo del operador no es igual al objeto de hash_multimap en el lado derecho.

bool operator!=(
   const hash_multimap <Key, Type, Traits, Allocator>& _Left,
   const hash_multimap <Key, Type, Traits, Allocator>& _Right
);

Parámetros

  • _Left
    Objeto de tipo hash_multimap.

  • _Right
    Objeto de tipo hash_multimap.

Valor devuelto

true si los hash_multimaps no son iguales; false si los hash_multimaps son iguales.

Comentarios

La comparación entre los objetos de hash_multimap se basa en pares una comparación de sus elementos.Dos hash_multimaps son iguales si tienen el mismo número de elementos y sus respectivos elementos tienen los mismos valores.De lo contrario, son desiguales.

En Visual C++ .NET 2003, los miembros de los archivos de encabezado <hash_map> y <hash_set> ya no están en el espacio de nombres std, pero se han movido bastante al espacio de nombres stdext.Vea El espacio de nombres stdext para obtener más información.

Ejemplo

// hash_multimap_op_ne.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multimap <int, int> hm1, hm2, hm3;
   int i;
   typedef pair <int, int> Int_Pair;

   for ( i = 0 ; i < 3 ; i++ )
   {
      hm1.insert ( Int_Pair ( i, i ) );
      hm2.insert ( Int_Pair ( i, i * i ) );
      hm3.insert ( Int_Pair ( i, i ) );
   }

   if ( hm1 != hm2 )
      cout << "The hash_multimaps hm1 and hm2 are not equal." << endl;
   else
      cout << "The hash_multimaps hm1 and hm2 are equal." << endl;

   if ( hm1 != hm3 )
      cout << "The hash_multimaps hm1 and hm3 are not equal." << endl;
   else
      cout << "The hash_multimaps hm1 and hm3 are equal." << endl;
}
  
  

Requisitos

Encabezado: <hash_map>

Stdext deEspacio de nombres:

Vea también

Referencia

Biblioteca de plantillas estándar