• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <flat_set>

    std::flat_multiset::max_size

    size_type max_size() const noexcept; // (1) C++23
    

    概要

    コンテナが格納できる要素の最大数を返す。 これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。

    戻り値

    container_type 型メンバ変数 c があるとして、c.max_size()

    計算量

    定数時間。

    #include <flat_set>
    #include <iostream>
    
    int main()
    {
      std::flat_multiset<int> fs;
    
      std::cout << fs.max_size() << std::endl;
    }
    

    出力例

    178956970
    

    言語バージョン

    • C++23

    処理系