hash_set::clear
[!NOTA]
Esta API está obsoleta.La alternativa es unordered_set Class.
Borra todos los elementos de un hash_set.
void clear( );
Comentarios
En Visual C++ .NET 2003, los miembros de los archivos de encabezado <hash_map> y <hash_set> ya no están en el espacio de nombres std, pero se han movido bastante al espacio de nombres stdext.Vea El espacio de nombres stdext para obtener más información.
Ejemplo
// 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;
}
Requisitos
Encabezado: <hash_set>
Stdext deEspacio de nombres: