list::emplace_front
Dodaje element skonstruowane w miejscu na początku listy.
void emplace_front( Type&& _Val );
Parametry
Parametr |
Opis |
_Val |
Element dodany do początku list — Klasa. |
Uwagi
Jeśli wyjątek list jest niezmieniony w lewo i jest rethrown wyjątek.
Przykład
// list_emplace_front.cpp
// compile with: /EHsc
#include <list>
#include <iostream>
#include <string>
int main( )
{
using namespace std;
list <string> c2;
string str("a");
c2.emplace_front( move( str ) );
cout << "Moved first element: " << c2.front( ) << endl;
}
Wymagania
Nagłówek: < listy >
Przestrzeń nazw: std