Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
[!NOTA]
Questo API è obsoleto.L'alternativa consiste unordered_map Class.
Test se il hash_map a sinistra dell'operatore non è uguale all'oggetto di hash_map a destra.
bool operator!=(
const hash_map <Key, Type, Traits, Allocator>& _Left,
const hash_map <Key, Type, Traits, Allocator>& _Right
);
Parametri
_Left
Oggetto di tipo hash_map._Right
Oggetto di tipo hash_map.
Valore restituito
true se i hash_maps non sono uguali; false se i hash_maps sono uguali.
Note
Il confronto tra oggetti di hash_map è basato pairwise su un confronto dei relativi elementi.Due hash_maps sono uguali se hanno lo stesso numero di elementi e i rispettivi elementi hanno gli stessi valori.In caso contrario, sono diversi.
In Visual C++ .NET 2003, i membri dei file di intestazione <hash_set> e <hash_map> non sono più nello spazio dei nomi di deviazione standard, ma sono stati spostati nello spazio dei nomi di stdext.Per ulteriori informazioni, vedere lo spazio dei nomi stdext.
Esempio
// hash_map_op_ne.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_map <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_maps hm1 and hm2 are not equal." << endl;
else
cout << "The hash_maps hm1 and hm2 are equal." << endl;
if ( hm1 != hm3 )
cout << "The hash_maps hm1 and hm3 are not equal." << endl;
else
cout << "The hash_maps hm1 and hm3 are equal." << endl;
}
Requisiti
intestazione: <hash_map>
Stdext diSpazio dei nomi: