设计模式C++实现(4)——饿汉懒汉之单例模式

#include <iostream> using namespace std; //懒汉 class Singleton { public: static Singleton *getInstance() { //Lock if (pInstance == NULL) { return new Singleton(); } //UnLook } priva
相关文章
相关标签/搜索