shared_dtor的另一种策略
来源:互联网 发布:网上开淘宝怎么开 编辑:程序博客网 时间:2024/06/06 05:17
#include <iostream>#include <fstream>#include <memory>#include <cstdio>using namespace std;class FileDtor{private: string filenames;public: FileDtor(string& name): filenames(name) { } void operator() (ofstream* fp){ fp->close; //close file std::remove(filenames.c_str());//delete file }};//这个程序的标题是其他策略,那就是行为像函数的类呗void main(){ shared_ptr<ofstream>fp(new ofstream("tmpFile.txt"), FileDtor("tmpFile.txt"));}
0 0
- shared_dtor的另一种策略
- C++的另一种错误处理策略
- 人民币的另一种用法
- SOAP的另一种使用方法
- using的另一种用法
- charindex的另一种使用
- 历史的另一种养分
- Msgbox的另一种替代
- using的另一种用法
- 另一种爱的方式
- Update的另一种写法
- 异常的另一种用法
- scanf的另一种用法
- 盗版软件的另一种理解
- marker的另一种用法
- 另一种形式的OufOfMemoryException
- 排列组合的另一种解法
- menu的另一种用法
- 初识Android进程间通信之----Binder机制
- 微软预科生计划skype在线面试题
- 浅谈 qmake 之 pro、pri、prf、prl文件
- Makefile编写
- LR监控Apache性能
- shared_dtor的另一种策略
- 9. Palindrome Number
- Eclipse ADB
- 5.3.2 实现与设置过滤器 使用@WebFilter标注或在web.xml中定义过滤器
- 线程停止
- R语言-Rwordseg中文分词包安装步骤
- Android学习笔记九:SQLiteDatabase中query、insert、update、delete方法参数说明
- ucos II 系统学习之------时间管理函数OSTimeGet()
- trait