Compartir a través de


hash_multimap::clear

Nota

Esta API está obsoleta.La alternativa es unordered_multimap (Clase).

Borra todos los elementos de un hash_multimap.

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, sino que se han movido al espacio de nombres stdext. Vea El espacio de nombres stdext para obtener más información.

Ejemplo

Al compilar este ejemplo con el marcador de /Wp64 o en una plataforma de 64 bits, el compilador que excluya C4267 se generará. Para obtener más información sobre esta advertencia, vea Advertencia del compilador (nivel 3) C4267.

// 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;
}
  

Requisitos

Encabezado: <hash_map>

Espacio de nombres: stdext

Vea también

Referencia

hash_multimap (Clase)

Biblioteca de plantillas estándar