Template Class Singleton
Defined in File singleton.hpp
Class Documentation
-
template<typename T>
class Singleton Singleton construction via the curiously recurring template pattern.
This class doesn’t provide singletons, but enables the construction of referenced based singletons via the curiously recurring template pattern.
If you wish to create a singleton, simply:
inherit this class (supplying your class as the template parameter).
this class is declared a friend.
your class has a protected constructor.
use a macro as shown below to call it.
#define Test TestObject::instance() ... cout << Test.value() << endl;
See also
src/test/singleton.cpp, Singletons
Public Functions
-
inline virtual ~Singleton()