#pragma once
template<class T>
class SingletonBase{
protected:
SingletonBase(){};
public:
SingletonBase(const SingletonBase&) = delete;
SingletonBase operator=(const SingletonBase&) = delete;
static T& instance(){
static T single; //no need for DCLP since C++11 (paragraph 6.7.4, static initialization)
return single;
}
};
Comments
0 B
|0 👍
/0 👎
0 B
|0 👍
/0 👎