Namespaces
Variants

std::allocator<T>:: max_size

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
size_type max_size ( ) const throw ( ) ;
(C++11まで)
size_type max_size ( ) const noexcept ;
(C++11から)
(C++17で非推奨)
(C++20で削除)

n が取り得る理論上の最大値を返します。この値に対して allocate ( n, 0 ) の呼び出しが成功する可能性があります。

ほとんどの実装では、これは std:: numeric_limits < size_type > :: max ( ) / sizeof ( value_type ) を返します。

パラメータ

(なし)

戻り値

サポートされる最大割り当てサイズ。

関連項目

[static]
アロケータがサポートする最大オブジェクトサイズを返す
( std::allocator_traits<Alloc> の公開静的メンバ関数)