VOOZH about

URL: https://www.geeksforgeeks.org/cpp/unordered_multiset-insert-in-c-stl/

⇱ unordered_multiset insert() function in C++ STL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

unordered_multiset insert() function in C++ STL

Last Updated : 24 Jun, 2021

The unordered_multiset::insert() is a built-in function in C++ STL that inserts new elements in the unordered_multiset. This increases the container size. Also notice that elements with the same value are also stored as many times they are inserted. 
Syntax: 
 

Unordered_multiset_name.insert(element)


Parameters: This function accepts a single parameter element. It specifies the element which is to be inserted into the container.
Return value: The function returns an iterator to the newly inserted element.
Below programs illustrate the above function: 
Program 1: 
 


Output
ums contains: papaya pineapple mango cherry grapes banana apple apple orange

Program 2: 
 


Output
ums contains: 8 7 9 3 2 4 4 6 5
Comment