![]() |
---|
此 API 已过时。另一种方法是 unordered_multiset Class。 |
插入构造的元素就地到 hash_multiset 中。
template<class ValTy>
iterator insert(
ValTy&& _Val
);
参数
Parameter |
描述 |
_Val |
要插入的元素的值设置为 hash_multiset Class,除非 hash_multiset,通常,已包含该元素或键相同地排序的元素。 |
返回值
emplace 成员函数返回指向位置插入新元素的迭代器。
备注
在 Visual C++ .NET 2003 中,<hash_map> 和 <hash_set> 标头文件的成员中不再标准,命名空间,而是将 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;
}
要求
标头: <hash_set>
命名空间: stdext