unordered_multiset::emplace_hint

添加就地构造一个元素。

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

参数

Parameter

说明

ValTy

就地构造函数参数类型。

val

要插入的值。

where

在插入 (仅提示的容器)。

备注

,在搜索的控件序列中的起始位置插入点,成员函数返回 insert(move(val)).first,使用 where 。 (插入某些可能更快,可能会发生,如果插入点紧邻或遵循 where。)

如果在插入时引发,容器未更改,并且异常来重新引发。

示例 

Dd998266.collapse_all(zh-cn,VS.110).gif代码

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

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

Dd998266.collapse_all(zh-cn,VS.110).gifOutput

After the emplace insertion, c1 contains: a

要求

**标题:**unordered_set

命名空间: std

请参见

参考

<unordered_set>

unordered_multiset Class

其他资源

unordered_set 成员