Sdílet prostřednictvím


operator!= (hash_map)

[!POZNÁMKA]

Toto rozhraní API je zastaralé.Alternativou je unordered_map Class.

Zkoušky, pokud objekt hash_map na levé straně operátoru není rovno hash_map objekt na pravé straně.

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

Parametry

  • _Left
    Objekt typu hash_map.

  • _Right
    Objekt typu hash_map.

Vrácená hodnota

true Pokud hash_maps není stejný; false hash_maps jsou-li shodné.

Poznámky

Párový porovnání jejich prvků vychází srovnání mezi hash_map objekty.Dva hash_maps jsou rovny, pokud mají stejný počet prvků a jejich odpovídajících prvky mají stejné hodnoty.Jinak nerovné.

V aplikaci Visual C++ .NET 2003, členové <hash_map> a <hash_set> jsou již v oboru názvů std soubory hlaviček, ale spíše být přesunut do oboru názvů stdext.Viz stdext obor názvů Další informace.

Příklad

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

Požadavky

Záhlaví: <hash_map>

Obor názvů: stdext

Viz také

Referenční dokumentace

Standardní šablona knihovny