设计模式
conetwo
csdn
展开
-
单例模式 new方式下的内存释放
单例模式 内存释放方式 new方式下的delete: https://blog.csdn.net/qq_34552886/article/details/70313613转载 2020-06-17 10:16:14 · 292 阅读 · 0 评论 -
设计模式-单例模式
保证一个类只有一个实例存在: 1. 构造函数私有化 2. 提供一个全局的静态方法 3.指向本类对象的静态指针 class Singelton { private: Singelton(); public: static Singelton *GetInstance() { if (psl == NULL) {原创 2017-04-08 20:56:04 · 206 阅读 · 0 评论