摘要: 转自:http://stackoverflow.com/questions/395123/raii-and-smart-pointers-in-cA simple (and perhaps overused) example of RAII is a File class. Without RAII, the code might look something like this:File file("/path/to/file");// Do stuff with filefile.close();In other words, we must make sure tha 阅读全文
posted @ 2013-04-27 16:57 Apprentice_ 阅读(271) 评论(0) 推荐(0)