摘要: 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()... 阅读全文
posted @ 2012-08-24 14:07 good90 阅读(273) 评论(0) 推荐(0) 编辑