上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 207 下一页

2011年8月17日

怎么能够在异常出现的情况下也能够释放堆内存资源?--------------智能指针 try-finally

摘要: 对于出现异常时,不能释放堆内存的问题:例如:#include <iostream> 02using namespace std; 03class normal_pointer_example 04{ 05public: 06normal_pointer_example(){cout<<"构造函数执行!\n";} 07~normal_pointer_example(){cout<<"析构函数执行!\n";} 08}; 09class normal_pointer_wrong{};//normal_pointer_wron 阅读全文

posted @ 2011-08-17 11:49 原来... 阅读(620) 评论(0) 推荐(0)

上一页 1 ··· 105 106 107 108 109 110 111 112 113 ··· 207 下一页

导航