June 2007
Intermediate to advanced
624 pages
15h 14m
English
I like to tidy up, because it gives me more room to play. | ||
| --Ben Wilson | ||
Will you help me to be less naughty, Daddy? | ||
| --Harry Wilson | ||
It is reasonable to assume that all C++ practitioners are aware of Resource Acquisition Is Initialization (RAII), even if they do not use that term. Essentially, it is about the business of getting hold of a resource—object, memory, file handle, and so on—in the constructor of an object and releasing it in the destructor. Classes that do this employ RAII and are often referred to as wrapper classes.
In Chapter 3 of Imperfect C++, I defined a taxonomy of RAII that I have found very useful in my work. This involves the permutations between two characteristics: mutability and resource source.
Read now
Unlock full access