次の方法で共有


operator!= (multiset)

演算子の左側の多重セットのオブジェクトが右側の複数のセット オブジェクトと等しくないかどうかを調べます。

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

パラメーター

  • _Left
    multiset 型のオブジェクト。

  • _Right
    multiset 型のオブジェクト。

戻り値

セットまたは複数セットがではないtrue ; セットまたは複数セットが等しい場合 false

解説

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

使用例

// multiset_op_ne.cpp
// compile with: /EHsc
#include <set>
#include <iostream>

int main( )
{
   using namespace std;
   multiset <int> s1, s2, s3;
   int i;

   for ( i = 0 ; i < 3 ; i++ )
   {
      s1.insert ( i );
      s2.insert ( i * i );
      s3.insert ( i );
   }

   if ( s1 != s2 )
      cout << "The multisets s1 and s2 are not equal." << endl;
   else
      cout << "The multisets s1 and s2 are equal." << endl;

   if ( s1 != s3 )
      cout << "The multisets s1 and s3 are not equal." << endl;
   else
      cout << "The multisets s1 and s3 are equal." << endl;
}
  
  

必要条件

ヘッダー: <set>

名前空間: std

参照

関連項目

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