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 类型的对象。

返回值

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

备注

在 hash_multiset 对象之间的比较。根据其元素之间存在着成对地比较。 两 hash_multisets 相等,如果变量具有相同数量的元素,它们各自的元素具有相同的值。 否则为不相等。

在Visual C++ .NET 2003中,成员<hash_map><hash_set> 头文件不再在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;
}
  

要求

Header: <hash_set>

**命名空间:**stdext

请参见

参考

标准模板库