std::allocator<T>:: max_size
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
(until C++20)
|
||||
|
(C++23)
|
||||
|
allocator::max_size
(until C++20)
|
||||
|
(until C++20)
|
||||
|
(until C++20)
|
||||
| Non-member functions | ||||
|
(until C++20)
|
|
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>
的公开静态成员函数)
|