c++ 通用单例类声明
//单例类定义
#define CLASS_INSTANCE_DEF(className) \
public: \
static className* GetInstance() \
{ \
static className m_Instance; \
return &m_Instance; \
} \
private: \
className() {} \
~className() {} \
className(const className&) = delete; \
className& operator=(const className&) = delete
class cTestInstance
{
CLASS_INSTANCE_DEF(cTestInstance);
public:
//后面添加自有函数参数定义
};