The ‘=’ is an operator in C++ STL which copies (or moves) an unordered_multiset to another unordered_multiset and unordered_multiset::operator= is the corresponding operator function. There are three versions of this function:
- The first version takes reference of an unordered_multiset as an argument and copies it to an unordered_multiset.
Parameters: The first version takes the reference of an unordered_multiset as argument.
- The second version performs a move assignment i.e it moves the content of an unordered_multiset to another unordered_multiset.
Parameters: The second version takes the r-value reference of an unordered_multiset as argument
- The third version assigns contents of an initializer list to an unordered_multiset.
Parameters: The third version takes an initializer list as argument.
Return Value: All of them return the value of this pointer(*this).
The following program illustrates unordered_multiset::operator= .
1 1 1 2 2 2 3 3 3 3 4 4 4 4 4 4 3 2 1 1 1 1 1 2 2 2 3 3 3 3 4 4 4 4 4
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Why overriding both the global new operator and the class-specific operator is not ambiguous?
- Operator Overloading '<<' and '>>' operator in a linked list class
- Ternary operator vs Null coalescing operator in PHP
- new vs operator new in C++
- map operator= in C++ STL
- set operator= in C++ STL
- 'AND' vs '&&' as operator in PHP
- dot (.) operator in C/C++
- map::operator in C++ STL
- unordered_map operator= in C++ STL
- PHP | Ternary Operator
- forward_list::operator= in C++ STL
- list::operator= in C++ STL
- vector::operator= and vector::operator[ ] in C++ STL
- deque::operator= and deque::operator in C++ STL
- array::operator[ ] in C++ STL
- multiset::operator= in C++ STL
- multimap::operator= in C++ STL
- match_results operator= in C++
- match_results operator in C++ STL
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.