suncode

  博客园 :: 首页 :: 新随笔 :: :: :: 管理 ::

随笔分类 -  设计模式

摘要:意图:保证一个类仅有一个实例,并提供一个访问的全局访问点--------------------singleton.h-----------------------View Code #ifndef SINGLETON_H#define SINGLETON_Hclass singleton{public: static singleton* instance();protected: singleton();private: static singleton* _instance;};#endif //SINGLETON_H---------------------singleton.cpp- 阅读全文
posted @ 2011-03-29 14:46 suncode 阅读(341) 评论(0) 推荐(0)