size_type max_size() const noexcept; // (1) C++26
概要
コンテナに格納可能な最大の要素数を取得する。
戻り値
コンテナに格納可能な最大の要素数
例外
投げない
計算量
定数時間
例
#include <hive>
#include <print>
int main()
{
std::hive<int> h;
std::println("{}", h.max_size());
}
出力例
768614336404564650
バージョン
言語
- C++26
処理系
- Clang: 22 ❌
- GCC: 16.1 ❌
- Visual C++: 2026 Update 2 ❌
関連項目
参照
- P0447R28 Introduction of
std::hiveto the standard library- C++26で
hiveが追加された
- C++26で