다음을 통해 공유


unordered_set::emplace_hint

위치에서 구성 요소를 추가 합니다.

template<class ValTy>
    iterator emplace_hint(const_iterator where, ValTy&& val);

매개 변수

Parameter

설명

ValTy

내부 생성자 인수 형식입니다.

val

삽입할 값입니다.

where

(참고만)를 삽입 하려면 컨테이너에 위치 합니다.

설명

멤버 함수 반환 insert(move(val)).first사용 하 여 where 내에서 제어 되는 시퀀스 삽입 지점에 대 한 검색을 시작 지점으로 합니다.(삽입 가능한 경우 발생할 수 있습니다 다소 빠르게 삽입 포인터 바로 앞에 또는 뒤에 오는 경우 where입니다.)

삽입 중에 예외를 throw 하는 경우 컨테이너 왼쪽입니다 변경 되지 및 해당 예외를 다시 throw 합니다.

예제 

Dd779103.collapse_all(ko-kr,VS.110).gif코드

// std_tr1__unordered_set__unordered_set_emplace_hint.cpp 
// compile with: /EHsc 
#include <unordered_set> 
#include <iostream>
#include <string> 
 
    unordered_set< string> c1;
    string str1("a");

    c1.emplace_hint(c1.begin(), move(str1));
    cout << "After the emplace insertion, c1 contains: "
        << *c1.begin() << endl;
 
     return (0); 
    } 
 

Dd779103.collapse_all(ko-kr,VS.110).gifOutput

After the emplace insertion, c1 contains: a

요구 사항

헤더: <unordered_set>

네임 스페이스: 국방 표준

참고 항목

참조

<unordered_set>

unordered_set Class

기타 리소스

<unordered_set> 멤버