設計模式C++實現(4)——餓漢懶漢之單例模式

#include <iostream> using namespace std; //懶漢 class Singleton { public: static Singleton *getInstance() { //Lock if (pInstance == NULL) { return new Singleton(); } //UnLook } priva
相關文章
相關標籤/搜索