#pragma once template class Singleton { protected: static T* ms_Singleton; public: explicit Singleton() { ms_Singleton = static_cast(this); } ~Singleton() { ms_Singleton = nullptr; } static T& GetSingleton(void) { return *ms_Singleton; } static T* GetSingletonPtr(void) { return ms_Singleton; } };