备注
此 API 已过时。替代为 unordered_multiset 类。
插入元素构造已到 hash_multiset。
template<class ValTy>
iterator insert(
ValTy&& _Val
);
参数
参数 |
说明 |
_Val |
待插入hash_multiset 类的元素的值,除非hash_multiset已经包含该元素,通常,一个元素的键是相同排序的。 |
返回值
emplace 成员函数返回指向新位置的元素插入的迭代器。
备注
在Visual C++ .NET 2003中,成员<hash_map> 和 <hash_set> 头文件不再在std命名空间,而是已经进入了stdext命名空间。 有关更多信息,请参见 stdext 命名空间。
示例
// hash_multiset_emplace.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
#include <string>
int main( )
{
using namespace std;
using namespace stdext;
hash_multiset<string> hms3;
string str1("a");
hms3.emplace(move(str1));
cout << "After the emplace insertion, hms3 contains "
<< *hms3.begin() << "." << endl;
}
要求
Header: <hash_set>
**命名空间:**stdext