Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Deletes the element at the beginning of a list.
void pop_front( );
Remarks
The first element must not be empty. pop_front never throws an exception.
Example
// 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;
}
The first element is: 1 The second element is: 2 After deleting the element at the beginning of the list, the first element is: 2
Requirements
Header: <list>
Namespace: std