Compartir a través de


hash_set::reference

Nota

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

Un tipo que proporciona una referencia a un elemento almacenados en un hash_set.

typedef list<typename Traits::value_type, typename Traits::allocator_type>::reference reference;

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

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

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_set <int> hs1;

   hs1.insert( 10 );
   hs1.insert( 20 );

   // Declare and initialize a reference &Ref1 to the 1st element
   int &Ref1 = *hs1.begin( );

   cout << "The first element in the hash_set is "
        << Ref1 << "." << endl;

   // The value of the 1st element of the hash_set can be changed
   // by operating on its (non-const) reference
   Ref1 = Ref1 + 5;

   cout << "The first element in the hash_set is now "
        << *hs1.begin() << "." << endl;
}
  

Requisitos

Encabezado: <hash_set>

Espacio de nombres: stdext

Vea también

Referencia

hash_set (Clase)

Biblioteca de plantillas estándar