Skip to content

Instantly share code, notes, and snippets.

View slogic's full-sized avatar

Simon Logic slogic

View GitHub Profile
template<class T>
class SingletonObjectFactory {
public:
SingletonObjectFactory() { if(!instance) instance = this; }
~SingletonObjectFactory() { if(instance == this) instance = NULL };
static T* getInstance() { return instance };
private:
static T* instance;