共用方式為


list::max_size

傳回清單的最大長度。

size_type max_size( ) const;

傳回值

清單的可能的最大長度。

範例

// 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;
}

範例輸出

下列輸出是 x86。

Maximum possible length of the list is 1073741823.

需求

標題: <list>

命名空間: std

請參閱

參考

list Class

標準樣板程式庫