Share via


operator!= (hash_multiset)

注意事項注意事項

這個 API 已經過時。這個選項是 unordered_set Class

測試,如果在運算子左方的 hash_multiset 物件等於右邊的 hash_multiset 物件不相等。

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

參數

  • _Left
    型別 hash_multiset 的物件。

  • _Right
    型別 hash_multiset 的物件。

傳回值

true ,如果 hash_multisets 不相等; false ,如果 hash_multisets 相等。

備註

在 hash_multiset 物件之間的比較是以其元素之間的比較中的方式。 兩 hash_multisets 相等,則它們具有相同項目數目,且其元素具有相同的值。 否則就是不相等。

在 Visual C++ .NET Pocket PC, <hash_map><hash_set> 標頭檔 (Header File) 的成員不在 std 命名空間,,而是移至 stdext 命名空間。 如需詳細資訊,請參閱 stdext 命名空間

範例

// hashset_op_ne.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>

int main( ) 
{
   using namespace std;
   using namespace stdext;
   hash_multiset <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_multisets hs1 and hs2 are not equal." << endl;
   else
      cout << "The hash_multisets hs1 and hs2 are equal." << endl;

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

需求

標題: <hash_set>

命名空間: stdext

請參閱

參考

標準樣板程式庫