#ifndef MYSINGLETON_H_ #define MYSINGLETON_H_ template class MySingleton { public: static T* instance() { static T _instance; return &_instance; } ; protected: MySingleton() { } ; virtual ~MySingleton() { } ; MySingleton(const MySingleton &); MySingleton& operator=(const MySingleton &); }; #endif