allocator_base::allocate
分配足够大内存块存储元素的至少某个指定数目。
template <class Other>
pointer allocate(size_type _Nx, const Other* _Hint = 0);
pointer allocate(size_type _Nx);
参数
Parameter |
说明 |
---|---|
_Nx |
元素数。将数组的。 |
_Hint |
忽略此参数。 |
返回值
对分配的对象的指针。
备注
用户定义的分配器的成员函数实现内存分配通过调用返回的结果传递给类型* 同步筛选器的 allocate 功能,如果 _Nx == 1,否则通过调用返回的结果传递到 operator new(_Nx * sizeof(Type)) 强制转换为类型*类型。
要求
**标题:**allocators
命名空间: stdext