The map::max_size() is a built-in function in C++ STL which returns the maximum number of elements a map container can hold.
Parameters: This function does not accept any parameters.
Return Value: This function returns the maximum number of elements a map container can hold.
The max size of mp1 is 461168601842738790 The max size of mp2 is 461168601842738790
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- multimap maxsize() in C++ STL
- Find original sequence from Array containing the sequence merged many times in order
- How to iterate over the elements of an std::tuple in C++
- Minimize swaps required to maximize the count of elements replacing a greater element in an Array
- How to access private/protected method outside a class in C++
- lvalues references and rvalues references in C++ with Examples
- Difference between cout and std::cout in C++
- C++ program to check whether a String is a Pangram or not
- Smallest subarray from a given Array with sum greater than or equal to K
- Generate a Number in Decreasing order of Frequencies of characters of a given String
- Check if a String contains any index with more than K active characters
- Difference between pair in Multiset and Multimap in C++ STL
- Search by value in a Map in C++
- How to use unordered_map efficiently in C++
- Count of pairs of Array elements which are divisible by K when concatenated
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.