摘要:
File:singleton.hpp 1 #ifndef __SINGLETON_HPP_ 2 #define __SINGLETON_HPP_ 3 4 template <class T> 5 class Singleton 6 { 7 public: 8 static T* Instance() { 9 if(!m_pInstance) m_pInstance = new T;10 assert(m_pInstance !=NULL);11 return m_pInstance;12 }13 protected:14 Singleton()... 阅读全文