Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017


Returns the maximum length of the map.

size_type max_size( ) const;

The maximum possible length of the map.

// map_max_size.cpp
// compile with: /EHsc
#include <map>
#include <iostream>

int main( )
   using namespace std;
   map <int, int> m1;
   map <int, int> :: size_type i;

   i = m1.max_size( );
   cout << "The maximum possible length "
        << "of the map is " << i << "."
        << endl << "(Magnitude is machine specific.)";

The following output is for x86.

The maximum possible length of the map is 536870911.
(Magnitude is machine specific.)

Header: <map>

Namespace: std

© 2018 Microsoft