测试,如果运算符左侧的多重集对象与右侧的多重集对象相等。
bool operator!==(
const multiset <Key, Traits, Allocator>& _Left,
const multiset <Key, Traits, Allocator>& _Right
);
参数
_Left
multiset 类型的对象。_Right
multiset 类型的对象。
返回值
true,如果运算符左侧的多重集与多集等于的位于运算符的右侧;为 false。
备注
如果在多重集对象之间的比较基于元素的一种比较成对。 两个集还是多重集等于的,则它们具有相同数量的元素,它们各自的元素具有相同的值。 否则为不相等。
示例
// multiset_op_eq.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 equal." << endl;
else
cout << "The multisets s1 and s2 are not equal." << endl;
if ( s1 == s3 )
cout << "The multisets s1 and s3 are equal." << endl;
else
cout << "The multisets s1 and s3 are not equal." << endl;
}
要求
标头: <set>
命名空间: std