![]() |
---|
此 API 已过时。另一种方法是 unordered_multiset Class。 |
如果 hash_multiset 为空,测试。
bool empty( ) const;
返回值
真,如果 hash_multiset 为空;假,如果 hash_multiset 非空。
备注
在 Visual C++ .NET 2003 中,<hash_map> 和 <hash_set> 标头文件的成员中不再标准,命名空间,而是将 stdext 命名空间。有关更多信息,请参见 stdext 命名空间。
示例
// hash_multiset_empty.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_multiset <int> hms1, hms2;
hms1.insert ( 1 );
if ( hms1.empty( ) )
cout << "The hash_multiset hms1 is empty." << endl;
else
cout << "The hash_multiset hms1 is not empty." << endl;
if ( hms2.empty( ) )
cout << "The hash_multiset hms2 is empty." << endl;
else
cout << "The hash_multiset hms2 is not empty." << endl;
}
要求
标头: <hash_set>
命名空间: stdext