摘要:
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 ); 阅读全文