Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class T>
- class CSingleton {
- private:
- static T* m_object = NULL;
- public:
- CSingleton() = delete;
- ~CSingleton() = delete;
- CSingleton(const CSingleton&) = delete;
- CSingleton& operator= (const CSingleton&) = delete;
- static T* get_instance() {
- if(!m_object) m_object = new T();
- return m_object;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement