Share via


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 クラス

標準テンプレート ライブラリ