时光飞逝~

2013年7月27日

23种设计模式--单例模式(懒汉)

摘要: 1 #include "stdafx.h" 2 3 //单例模式之懒汉模式 4 class Singleton 5 { 6 public: 7 static Singleton& GetInstance() 8 { 9 if(m_spInstance==NULL)10 {11 m_spInstance = new Singleton;12 }13 m_snCount++;14 return *m_spInstance;15 }16 void Release... 阅读全文

posted @ 2013-07-27 10:02 时光飞逝~ 阅读(220) 评论(0) 推荐(0)