Compartir a través de


set::reference

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

typedef typename allocator_type::reference reference;

Ejemplo

// set_reference.cpp
// compile with: /EHsc
#include <set>
#include <iostream>

int main( )
{
   using namespace std;
   set <int> s1;

   s1.insert( 10 );
   s1.insert( 20 );

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

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

Requisitos

Encabezado: <set>

Espacio de nombres: std

Vea también

Referencia

set (Clase)

Biblioteca de plantillas estándar