class Singleton
{
public:
static Singleton* Instance();
protected:
Singleton();
private:
static Singleton* _instance;
};
Singleton* Singleton::Instance()
{
if (_instance == 0)
{
_instance = new
Singleton();
}
return _instance;
}
Singleton* sgn = Singleton::Instance();
Copyright 2011-2020 © MallocFree. All rights reserved.