Audacity 3.2.0
|
Can guarantee that the global variable's lifetime encloses those of other objects of static duration. More...
#include <GlobalVariable.h>
Public Member Functions | |
Initializer () | |
Can guarantee that the global variable's lifetime encloses those of other objects of static duration.
This is like the "nifty counter" idiom. The guarantee is not automatic, but you can define a static
instance in a multiply included header file, which creates multiple Initializers, but only one of them causes the initial construction of the variable.
This makes it safe for other calls to Get() to occur inside the bodies of both the constructor and destructor of another long-lived object. Such objects can be freely defined by other translation units that include the header with no extra effort.
Definition at line 117 of file GlobalVariable.h.
|
inline |
Definition at line 117 of file GlobalVariable.h.
References GlobalVariable< Tag, Type, initializer, ScopedOnly >::Initializer::Initializer(), and GlobalVariable< Tag, Type, initializer, ScopedOnly >::Instance().
Referenced by GlobalVariable< Tag, Type, initializer, ScopedOnly >::Initializer::Initializer().