std::allocator<T>::max_size
来自cppreference.com
动态内存管理
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::allocator
| 成员函数 | ||||
|
(C++20
前)
|
||||
|
(C++23)
|
||||
|
allocator::max_size
(C++20
前)
|
||||
|
(C++20
前)
|
||||
|
(C++20
前)
|
||||
| 非成员函数 | ||||
|
(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) 。
参数
(无)
返回值
受支持的最大分配大小
参阅
|
[静态]
|
返回分配器所支持的最大对象大小 ( std::allocator_traits<Alloc>
的公开静态成员函数) |