摘要:
A 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 that we close the file once we've finished with it. This has two drawb 阅读全文
2011年7月11日 #