C++ 内存库 - auto_ptr



描述

它是一个自动指针,它为指针提供了一个有限的垃圾回收功能,通过允许指针在 auto_ptr 对象本身被销毁时自动销毁它们指向的元素。

声明

以下是 std::auto_ptr 函数的声明。

template <class X> class auto_ptr;

C++11

template <class X> class auto_ptr;

参数

X − 它是一个被管理的对象。

成员类型

成员类型 定义 备注
element_type 类模板参数 (X) 被管理对象的类型
memory.htm
广告

© . All rights reserved.