dart
|
Singleton template class. More...
#include <Singleton.hpp>
Static Public Member Functions | |
template<typename... Args> | |
static T & | getSingleton (Args... _args) |
Returns reference of the singleton. | |
template<typename... Args> | |
static T * | getSingletonPtr (Args... _args) |
Returns pointer of the singleton. | |
Protected Member Functions | |
Singleton ()=default | |
Constructor. | |
virtual | ~Singleton ()=default |
Destructor. | |
Singleton template class.
// Singletone class Engine class Engine : public Singleton<Engine> {};
// Call before main() and use theT only instead of calling getSingleton() static T& theT = T::getSingleton();