---
title: Allocator构造函数和析构函数
description: "Allocator构造函数和析构函数。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00278.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00278.html
indexId: dfc70f50e1c6304c0f8d6c15423ac7a361ff9de48bb22233b74a3dcd227e177978
---
# Allocator构造函数和析构函数

#### 函数功能

Allocator构造函数和析构函数。


#### 函数原型

```
Allocator() = default
virtual ~Allocator() = default
Allocator(const Allocator &) = delete
Allocator &operator=(const Allocator &) = delete
```


#### 参数说明

无。


#### 返回值

无。


#### 异常处理

无。


#### 约束说明

纯虚类需要用户派生。
