Compartir a través de


hash_multiset::reference

[!NOTA]

Esta API está obsoleta.La alternativa es unordered_multiset Class.

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

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

Ejemplo

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

int main( )
{
   using namespace std;   
   using namespace stdext;
   hash_multiset <int> hms1;

   hms1.insert( 10 );
   hms1.insert( 20 );

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

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

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

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

Requisitos

Encabezado: <hash_set>

Stdext deEspacio de nombres:

Vea también

Referencia

hash_multiset Class

Biblioteca de plantillas estándar