首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::allocator_traits::allocate

Defined in header <memory>

?

?

static pointer allocate( Alloc& a, size_type n );

(1)

(since C++11)

static pointer allocate( Alloc& a, size_type n, const_void_pointer hint );

(2)

(since C++11)

使用分配器a分配n*sizeof(Alloc::value_type)未初始化存储的字节。

1%29次电话a.allocate(n)

2%29附加传递内存局部性提示hint.电话a.allocate(n, hint)如果可能的话。如果不可能的话,%28例如。a没有双参数成员函数分配%28%29%29,调用a.allocate(n)

参数

a

-

allocator to use

n

-

the number of objects to allocate storage for

hint

-

pointer to a nearby memory location

返回值

调用返回的指针。a.allocate(n)...

另见

allocate

allocates uninitialized storage (public member function of std::allocator)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com