Sdílet prostřednictvím


hash_set::clear

[!POZNÁMKA]

Toto rozhraní API je zastaralé.Alternativou je unordered_set Class.

Vymaže všechny prvky hash_set.

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

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

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

   cout << "The size of the hash_set is initially " << hs1.size( )
        << "." << endl;

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

Požadavky

Záhlaví: <hash_set>

Obor názvů: stdext

Viz také

Referenční dokumentace

hash_set Class

Standardní šablona knihovny