摘要:
转自:http://www.cppblog.com/sandy/archive/2005/11/30/1436.htmltemplateclassSingleton{protected:staticT*ms_Singleton;public:Singleton(void){assert(!ms_Singleton);ms_Singleton=static_cast(this);}~Singleton(void){assert(ms_Singleton);ms_Singleton=0;}staticT&getSingleton(void){assert(ms_Singleton);ret 阅读全文