lpstd/src/patterns/singleton.hpp

23 lines
367 B
C++

namespace lpstd
{
template <typename T>
class Singleton
{
public:
static T &Instance()
{
static T _instance;
return _instance;
}
protected:
Singleton() {}
~Singleton() {}
private:
Singleton(Singleton const &);
Singleton &operator=(Singleton const &);
};
}