What is a common naming convention for RAII classes?

c++, naming-conventions, raii

Solution

RAII should be used all throughout the language. Since it should be the default, there's is no naming convention to follow.

Problem

In C++, when using the Resource Acquisition is Initialization (RAII) pattern, are there any common conventions for naming the classes? In my case, I have classes which do the following kinds of things and I would like names which are likely to invoke a useful meaning to a first time reader when seeing one of these on the stack: - A class to suppress logging (which can be nested). - A class to put in place an observer. - A class to record the current object being processed for the current thread. - A derived class to process the object in addition to the base class behavior (in prior line). As a first cut, I have used names like these (in corresponding order to above), but hope to improve upon them: - class SuppressLogger - class ScopedObserver - class WithCurrentObject - class WithObjectProcessed : public WithCurrentObject

Original source