Initializing Static Objects

Global static objects are initialized in the order they occur in the source. They are destroyed in the reverse order. However, across translation units, the order of initialization is dependent on how the object files are arranged by the linker; destruction still takes place in the reverse order that objects were constructed.

Local static objects are initialized when they are first encountered in the program flow, and they are destroyed in the reverse order at program termination. Destruction of local static objects occurs only if the object was encountered in the program flow and initialized.