Scalable automatic class registration in C++
Automatic class registration in C++ is a common task, and a commonly asked question here on StackOverflow: Register an object creator in object factory Somehow register my classes in a list automatic registration of object creator function with a macro c++ automatic factory registration of derived types The basic objective is to register classes automatically with some registry or factory so that it can do some work with each class later. This is a well-established technique, used by libraries like (for example) Google Test ( http://code.google.com/p/googletest ), which automatically registers