摘要
通过对C++中编码的风险性和异常安全性的讨论,提出了一种使用智能指针解决资源泄漏问题的方法。通过构建智能指针,保证了在异常条件下对资源控制的有效性,并通过实例进行了测试。最后,对该方法进行了讨论。
This paper puts forward a new method to solve the problem of resource leaks by means of smart
pointer,which can prevent resource leaks and ensure exception safety in C++ coding.Starting
with an analysis of existing programs,the general concept of smart pointers is extracted.The
last presented in the form of tests and detailed instructions.
出处
《计算机安全》
2007年第8期63-67,共5页
Network & Computer Security