다음을 통해 공유


operator!=(hash_set)

참고

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

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

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

매개 변수

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

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

반환 값

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

설명

The comparison between hash_set objects is based on a pairwise comparison between their elements. Two hash_sets 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_set_op_ne.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>

int main( ) 
{
   using namespace std;
   using namespace stdext;
   hash_set <int> hs1, hs2, hs3;
   int i;

   for ( i = 0 ; i < 3 ; i++ )
   {
      hs1.insert ( i );
      hs2.insert ( i * i );
      hs3.insert ( i );
   }

   if ( hs1 != hs2 )
      cout << "The hash_sets hs1 and hs2 are not equal." << endl;
   else
      cout << "The hash_sets hs1 and hs2 are equal." << endl;

   if ( hs1 != hs3 )
      cout << "The hash_sets hs1 and hs3 are not equal." << endl;
   else
      cout << "The hash_sets hs1 and hs3 are equal." << endl;
}
  

요구 사항

헤더: <hash_set>

네임스페이스: stdext

참고 항목

참조

표준 템플릿 라이브러리