The unordered_multiset::emplace_hint() is a built-in function in C++ STL which inserts a new element in the unordered_multiset container. It starts searching from the position provided in the parameter for the insertion point of the element. The position only acts as a hint, it does not decide the position at which the insertion is to be done. The insertion is done automatically at the position according to the container’s criterion. It increases the size of the container by one.
unordered_multiset_name.emplace_hint(iterator position, val)
Parameters: The function accepts two mandatory parameters which are described below:
- position: it specifies the iterator pointing to the position from where search operation for insertion is to be started.
- val: it specifies the element which is to be inserted in the container.
Return Value: It returns an iterator which points to the newly inserted element.
Below programs illustrates the above function:
Elements: 14 11 11 11 12 13 13
Elements: d a a a b b c
- Function Overloading vs Function Overriding in C++
- How to call some function before main() function in C++?
- What happens when a virtual function is called inside a non-virtual function in C++
- Difference between Virtual function and Pure virtual function in C++
- div() function in C++
- exp() function C++
- log() function in C++
- fma() function in C++
- array get() function in C++ STL
- array at() function in C++ STL
- mbrlen() function in C/C++
- unordered_map end( ) function in C++ STL
- strcspn() function in C/C++
- strrchr() function in C/C++
- strtoimax() function in C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.