M
Michael
Ok,
I've got a Singleton template:
template<class T>
class Singleton
{
public:
static T& GetInstance()
{
static T* pInst= NULL;
if(pInst == NULL) pInst = new T;
return &pInst;
}
};
Then to use it, I do the following:
class FileSystem: public Singleton<FileSystem>
{
/*
I've got a Singleton template:
template<class T>
class Singleton
{
public:
static T& GetInstance()
{
static T* pInst= NULL;
if(pInst == NULL) pInst = new T;
return &pInst;
}
};
Then to use it, I do the following:
class FileSystem: public Singleton<FileSystem>
{
/*