hash_multiset::clear
[!メモ]
この API は、互換性のために残されています。代わりに unordered_multiset クラスです。
hash_multisetのすべての要素を消去します。
void clear( );
解説
Visual C++ .NET 2003では、<hash_map> と <hash_set> ヘッダー ファイルのメンバーはstdの名前空間に存在しなくなりましたが、ではなくstdextの名前空間に型。詳細については、「The stdext Namespace」を参照してください。
使用例
// 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;
}
必要条件
ヘッダー: <hash_set>
名前空間: のstdext