hash_multiset::size
![]() |
---|
這個 API 已經過時。替代方案是 unordered_multiset 類別。 |
傳回的項目數 hash_multiset 的。
size_type size( ) const;
傳回值
hash_multiset 的目前長度。
備註
在 Visual C++ .NET 2003 中, <hash_map> 和 <hash_set> 標頭檔的成員不在 std 命名空間中,而是移至 stdext 命名空間。 如需詳細資訊,請參閱 stdext 命名空間。
範例
// hash_multiset_size.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_multiset <int> hms1;
hash_multiset <int> :: size_type i;
hms1.insert( 1 );
i = hms1.size( );
cout << "The hash_multiset length is " << i << "." << endl;
hms1.insert( 2 );
i = hms1.size( );
cout << "The hash_multiset length is now " << i << "." << endl;
}
需求
標頭: <hash_set>
**命名空間:**stdext