hash_multiset::emplace_hint

说明说明

此 API 已过时。另一种方法是 unordered_multiset Class

插入构造的元素就地到一 hash_multiset 中,具有位置提示。

template<class ValTy>
    iterator insert(
        const_iterator _Where,
        ValTy&& _Val
);

参数

Parameter

描述

_Val

要插入的元素的值设置为 hash_multiset Class,除非 hash_multiset,通常,已包含该元素或键相同地排序的元素。

_Where

起始位置搜索正确位置插入。(插入在能够的常量时发生,而不是对数时,因此,如果插入点紧跟在 _Where。)

返回值

hash_multiset::emplace 成员函数返回指向位置新元素插入 hash_multiset的迭代器。

备注

如果插入点紧跟在 _Where,在将能够的常量时发生,而不是对数时间。

在 Visual C++ .NET 2003 中,<hash_map><hash_set> 标头文件的成员中不再标准,命名空间,而是将 stdext 命名空间。有关更多信息,请参见 stdext 命名空间

示例

// hash_multiset_emplace_hint.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
#include <string>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multiset<string> hms1;
   string str1("a");

   hms1.insert(hms1.begin(), move(str1));
   cout << "After the emplace insertion, hms1 contains "
      << *hms1.begin() << "." << endl;
}
  

要求

标头: <hash_set>

命名空间: stdext

请参见

参考

hash_multiset Class

标准模板库