C++程序员们快来写简洁的单例模式吧
想必每一位程序员都对设计模式中的单例模式非常的熟悉吧,以往我们用C++实现一个单例模式需要写以下代码: 1 class CSingleton 2 { 3 private: 4 CSingleton() //构造函数是私有的 5 { 6 } 7 static CSingleton *m_pInstance; 8 public: 9 static CSingleton * GetInstance() 10 { 11
下载地址
用户评论