Compartilhar via


hash_multiset::emplace

Note

This API is obsolete. The alternative is unordered_multiset Class.

Inserts an element constructed in place into a hash_multiset.

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

Parameters

Parameter

Description

_Val

The value of an element to be inserted into the hash_multiset Class unless the hash_multiset already contains that element or, more generally, an element whose key is equivalently ordered.

Return Value

The emplace member function returns an iterator that points to the position where the new element was inserted.

Remarks

In Visual C++ .NET 2003, members of the <hash_map> and <hash_set> header files are no longer in the std namespace, but rather have been moved into the stdext namespace. See The stdext Namespace for more information.

Example

// 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;
}
After the emplace insertion, hms3 contains a.

Requirements

Header: <hash_set>

Namespace: stdext

See Also

Reference

hash_multiset Class

Standard Template Library