最終更新日時(UTC):
が更新

履歴 編集

function
<forward_list>

std::forward_list::max_size(C++11)

size_type max_size() const noexcept;

概要

コンテナに格納可能な最大数を取得する。

戻り値

コンテナに格納可能な最大数

例外

投げない

計算量

定数時間

#include <iostream>
#include <forward_list>

int main()
{
  std::forward_list<int> ls;
  std::size_t s = ls.max_size();

  std::cout << s << std::endl;
}

出力例

1152921504606846975

バージョン

言語

  • C++11

処理系

参照