摘要: 1. static ScriptingCore *getInstance() { static ScriptingCore* pInstance = NULL; if (pInstance == NULL) { pInstance = new ScriptingCore(); } return pInstance; };真正做到只能调用getInstance访问数据。2.template<typename T>class Singleton{ static T* ms_singleton;public: Singleton() { ENSURE( !ms_singleton ); 阅读全文
posted @ 2013-05-12 13:03 城市*斗士(技术) 阅读(188) 评论(0) 推荐(0) 编辑