#define DECLARINSTANCE(name) \
public:\
static name* GetInstance(){\
if(instance == nullptr){\
instance = new name;\
}\
return instance;\
}\
private:\
class GC{\
public:\
GC(){}\
~GC(){\
if(instance){\
delete instance;\
instance = nullptr;\
}\
}\
};\
private:\
static GC gc;\
static name* instance;\
name();\
public:\
virtual ~name();
#define DEFINEINSTACE(name) \
name *name::instance = nullptr;\
name::GC name::gc;