Share via


operator!= (hash_multiset)

[!メモ]

この API は、互換性のために残されています。代わりに unordered_set クラスです。

演算子の左側の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 型のオブジェクト。

戻り値

hash_multisetsがではないtrue ; hash_multisetsが等しい場合 false

解説

hash_multisetのオブジェクトの比較は、要素間には一対の比較に基づいています。2個のhash_multisetsは、要素の数が同じで、対応する要素の値が同じ同じです。それ以外の場合は等しくありません。

Visual C++ .NET 2003では、<hash_map><hash_set> ヘッダー ファイルのメンバーはstdの名前空間に存在しなくなりましたが、ではなくstdextの名前空間に型。詳細については、「The stdext Namespace」を参照してください。

使用例

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

参照

関連項目

標準テンプレート ライブラリ