#include <stddef.h>template<typename T>class Singleton{public: static T &getInstance () { if(NULL == instance) { instance = new T(); } return *instance; } static void delInstance () { if(NULL != instance) { delete instance; instance = NULL; } }protected: Singleton () { } ~Sing Read More
posted @ 2011-02-15 15:07 BloodAndBone Views(367) Comments(0) Diggs(1) Edit