
设计模式
子墨777
Try to make yourself more excellent!
展开
-
设计模式--简单工厂模式
#include <iostream> using namespace std; class singlecore{ public: virtual void show(){}; }; class coreA :public singlecore{ void show(){ cout<<"in class coreA" <<...原创 2020-03-23 15:47:28 · 94 阅读 · 0 评论 -
设计模式之单例模式
#include<iostream>//懒汉式 using namespace std; class Singleton{ private: static Singleton *instance; Singleton(){}; public: static Singleton * getinstance(){ if (instance...原创 2020-03-23 15:07:24 · 92 阅读 · 0 评论