hash_multimap::clear
[!POZNÁMKA]
Toto rozhraní API je zastaralé.Alternativou je unordered_multimap Class.
Vymaže všechny prvky hash_multimap.
void clear( );
Poznámky
V aplikaci Visual C++ .NET 2003, členové <hash_map> a <hash_set> jsou již v oboru názvů std soubory hlaviček, ale spíše být přesunut do oboru názvů stdext.Viz stdext obor názvů Další informace.
Příklad
Při kompilaci v tomto příkladu se /Wp64 příznak nebo na 64bitové platformě budou generovány kompilátoru upozornění C4267.Další informace o tomto upozornění naleznete v C4267 (úroveň 3) upozornění kompilátoru.
// hash_multimap_clear.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>
int main()
{
using namespace std;
using namespace stdext;
hash_multimap<int, int> hm1;
hash_multimap<int, int>::size_type i;
typedef pair<int, int> Int_Pair;
hm1.insert(Int_Pair(1, 1));
hm1.insert(Int_Pair(2, 4));
i = hm1.size();
cout << "The size of the hash_multimap is initially "
<< i << "." << endl;
hm1.clear();
i = hm1.size();
cout << "The size of the hash_multimap after clearing is "
<< i << "." << endl;
}
Požadavky
Záhlaví: <hash_map>
Obor názvů: stdext