다음을 통해 공유


list::emplace

장소에는 목록에 지정 된 위치에 구성 요소를 삽입 합니다.

void emplace_back(
   iterator _Where,
   Type&& _Val
); 

매개 변수

Parameter

설명

_Where

대상에서 위치 list Class 첫 번째 요소를 삽입 합니다.

_Val

끝에 추가 되는 요소는 list.

설명

예외가 발생 하는 경우는 list 예외를 다시 throw 하 고 왼쪽 변경 되지 않습니다.

예제

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

int main( ) 
{
   using namespace std;
   list <string> c2;
   string str("a");

   c2.emplace(c2.begin(), move( str ) );
   cout << "Moved first element: " << c2.back( ) << endl;
}
  

요구 사항

헤더: <list>

네임 스페이스: std

참고 항목

참조

list Class

표준 템플릿 라이브러리