摘要:
1. 简单工厂模式 #include <iostream> using namespace std; class Shoes { public: virtual ~Shoes() {} virtual void Show() = 0; }; class LiNingShoes : public Sh 阅读全文
posted @ 2020-10-17 04:32
xytpai
阅读(142)
评论(0)
推荐(0)
摘要:
单例模式 单例模式中一个类只有一个对应实例 1. 懒汉式 #include <iostream> using namespace std; class foo { public: static foo* GetInstance(int data1) { if (m_pInstance == null 阅读全文
posted @ 2020-10-17 00:27
xytpai
阅读(234)
评论(0)
推荐(0)

浙公网安备 33010602011771号