// Singleton.h
#ifndef SINGLETON_H
#define SINGLETON_H
// 单例模板类
template<typename T>
class Singleton
{
public:
static T* getInstance(void)
{
if (m_pInstance == nullptr)
{
m_pInstance = new T();
}
return m_pInstance;
}
protected:
Singleton(void){
}
virtual ~Singleton(void){
}
private:
static T
模板单例类
最新推荐文章于 2022-07-10 12:05:57 发布