摘要:
#include #include using namespace std;class singleton{private: singleton(){}; //构造函数为private,禁止客户new出实例 virtual ~singleton() { if (instance!=NULL) delete instance; }; static singleton *instance;public: static singleton *GetInstance() { if (instance==NULL... 阅读全文