다음을 통해 공유


operator!=(hash_map)

참고

이 API는 사용되지 않습니다.unordered_map 클래스를 대신 사용하는 것이 좋습니다.

Tests if the hash_map object on the left side of the operator is not equal to the hash_map object on the right side.

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

매개 변수

  • _Left
    hash_map 형식의 개체입니다.

  • _Right
    hash_map 형식의 개체입니다.

반환 값

true if the hash_maps are not equal; false if hash_maps are equal.

설명

The comparison between hash_map objects is based on a pairwise comparison of their elements. Two hash_maps are equal if they have the same number of elements and their respective elements have the same values. 그렇지 않으면 두 개체는 서로 다른 개체입니다.

Visual C++.NET 2003에서, <hash_map><hash_set> 헤더 파일의 멤버는 더 이상 std 네임스페이스에 존재하지 않습니다. 대신 stdext 네임스페이스로 이동되었습니다. 자세한 내용은 stdext 네임스페이스를 참조하십시오.

예제

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

요구 사항

헤더: <hash_map>

네임스페이스: stdext

참고 항목

참조

표준 템플릿 라이브러리