The multiset::max_size() is an observer function in C++ STL which returns the maximum number of elements a container can hold. This limit might be due to system or library implementations. Being an observer function it does not modify the multiset in any way.
Parameters: This function does not accept any parameters.
Return Value: This method returns a positive integer denoting the maximum number of elements the container can hold.
Note: The value returned by this function is usually the theoretical limit of the size of the container. However, at runtime, the size of the container may be limited to a value less than that returned by max_size() function due to RAM limitations.
The program below demonstrates the use of unordered_multiset::max_size()
Number of elements the multiset can hold is: 4294967295
Rated as one of the most sought after skills in the industry, own the basics of coding with our C++ STL Course and master the very concepts by intense problem-solving.
- multimap maxsize() in C++ STL
- multiset::operator= in C++ STL
- multiset::swap() in C++ STL
- multiset::emplace() in C++ STL
- multiset lower_bound() in C++ STL with Examples
- multiset max_size() in C++ STL with Examples
- multiset find() function in C++ STL
- multiset equal_range() function in C++ STL
- multiset emplace_hint() function in C++ STL
- multiset rbegin() and rend() function in C++ STL
- multiset begin() and end() function in C++ STL
- multiset size() in C++ STL with Examples
- multiset get_allocator() function in C++ STL
- multiset key_comp() function in C++ STL
- multiset value_comp() method in C++ STL
- multiset erase() in C++ STL
- Difference between pair in Multiset and Multimap in C++ STL
- Multiset in C++ Standard Template Library (STL)
- multiset clear() function in C++ STL
- multiset insert() function 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.
Improved By : nidhi_biet