auto_ptr的用法
来源:互联网 发布:编程世界 编辑:程序博客网 时间:2024/05/21 15:38
auto_ptr不神秘,其作用就是当自己死了的时候,拖着别人一起死——delete其指向的东西。
#include <iostream>
#include <memory>
using namespace std;
class a {
public:
~a(){cout << "dtor" << endl;};
};
int main()
{
std::auto_ptr<a> aa(new(a));
return 0;
}
[root@localhost tmpc++]# g++ s9.cpp -o s9
[root@localhost tmpc++]# ./s9
dtor
- auto_ptr的用法
- C++ auto_ptr的用法
- auto_ptr智能指针的用法
- auto_ptr用法
- auto_ptr用法
- C++ auto_ptr智能指针的用法
- std::auto_ptr和tr1::shared_ptr的用法
- C++ auto_ptr 智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- C++ auto_ptr智能指针的用法
- auto_ptr基本用法和实现的整理
- C++ auto_ptr智能指针的用法
- 测试CSDN哪些号未注册
- C# 绘制统计图(柱状图, 折线图, 扇形图)
- JDK,JRE,JVM的区别[转]
- instead of触发器
- NAND FLASH的MLC和SLC架构区别
- auto_ptr的用法
- C#——小编浅谈如何在DataGridView控件中验证数据输入
- Observer设计模式——委托事件
- Net资源泄露(内存泄露,GDI泄露,handle 泄露等)的终极解决方案
- 2009年手机软件外包的经验和教训
- 协程三篇之一(协程初接触)
- C#经典面试之算法
- 建立IIS,局域网中的电脑访问我机器上的网页
- Entity SQL Language 二 基本执行方法、操作符、Select及Where