- flat_set[meta header]
- std[meta namespace]
- flat_multiset[meta class]
- function[meta id-type]
- cpp23[meta cpp]
size_type max_size() const noexcept; // (1) C++23
constexpr size_type max_size() const noexcept; // (1) C++26コンテナが格納できる要素の最大数を返す。 これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。
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;
}- max_size()[color ff0000]
178956970
- C++23
- Clang: ??
- GCC: ??
- Visual C++: ??