Saturday, 16 June 2018

signleton desinpattern

class Singleton
{
  …...
static Singleton *_instance;


Public:
  static Singleton* getInstance();
}


Singleton* Singleton::getInstance()
{
 if(!_instance)
   _instance = new Singleton;
  return _instance;
}




No comments:

Post a Comment