Compartir a través de


list::pop_front

Elimina el elemento al principio de una lista.

void pop_front( );

Comentarios

El primer elemento no debe estar vacío.pop_front nunca produce una excepción.

Ejemplo

// list_pop_front.cpp
// compile with: /EHsc
#include <list>
#include <iostream>

int main( ) 
{
   using namespace std;
   list <int> c1;
   
   c1.push_back( 1 );
   c1.push_back( 2 );
   cout << "The first element is: " << c1.front( ) << endl;
   cout << "The second element is: " << c1.back( ) << endl;

   c1.pop_front( );
   cout << "After deleting the element at the beginning of the list, "
         "the first element is: " << c1.front( ) << endl;
}
  

Requisitos

encabezado: <lista>

espacio de nombres: std

Vea también

Referencia

list Class

Biblioteca de plantillas estándar