hash_multiset::clear

备注

此 API 已过时。替代为 unordered_multiset 类

清除 hash_multiset 的所有元素。

void clear( );

备注

在Visual C++ .NET 2003中,成员<hash_map><hash_set> 头文件不再在std命名空间,而是已经进入了stdext命名空间。 有关更多信息,请参见 stdext 命名空间

示例

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

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multiset <int> hms1;
   
   hms1.insert( 1 );
   hms1.insert( 2 );

   cout << "The size of the hash_multiset is initially " << hms1.size( )
        << "." << endl;

   hms1.clear( );
   cout << "The size of the hash_multiset after clearing is " 
        << hms1.size( ) << "." << endl;
}
  

要求

Header: <hash_set>

**命名空间:**stdext

请参见

参考

hash_multiset 类

标准模板库