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.


Returns the maximum length of the map.

size_type max_size( ) const;

Return Value

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 maximum possible length of the map is 536870911.
(Magnitude is machine specific.)

See Also

map Class | map Members | map::max_size, clear, erase, and size Sample

© 2014 Microsoft