定义于头文件
<scoped_allocator>
|
||
(1) | ||
pointer allocate( size_type n );
|
(C++11 起) (C++20 前) |
|
[[nodiscard]] pointer allocate( size_type n );
|
(C++20 起) | |
(2) | ||
pointer allocate( size_type n, const_void_pointer hint );
|
(C++11 起) (C++20 前) |
|
[[nodiscard]] pointer allocate( size_type n, const_void_pointer hint );
|
(C++20 起) | |
用外层分配器分配未初始化存储。
n | - | 要分配存储的对象数 |
hint | - | 指向临近内存位置的指针 |
指向分配存储的指针
分配未初始化的存储 ( std::allocator 的公开成员函数)
|
|
[静态]
|
用分配器分配未初始化的存储 ( std::allocator_traits 的公开静态成员函数)
|