Showing posts with label RAII. Show all posts
Showing posts with label RAII. Show all posts

Sunday, July 15, 2012

The RAII Idiom

The essence of the RAII idiom is that the class file encapsulates the management of any finite resource, like the FILE* file handle. It guarantees that the resource will properly be disposed of at function exit. Furthermore, file instances guarantee that a valid log file is available (by throwing an exception if the file could not be opened).

http://en.wikibooks.org/wiki/C%2B%2B_Programming/RAII