Windows Dev Center

Information
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.

list::max_size

Returns the maximum length of a list.

size_type max_size( ) const;

The maximum possible length of the list.

// list_max_size.cpp
// compile with: /EHsc
#include <list>
#include <iostream>

int main( ) 
{
   using namespace std;
   list <int> c1;
   list <int>::size_type i;

   i = c1.max_size( );
   cout << "Maximum possible length of the list is " << i << "." << endl;
}

The following output is for x86.

Maximum possible length of the list is 1073741823.

Header: <list>

Namespace: std

Show:
© 2015 Microsoft