danicoin/src/mnemonics/singleton.h
2014-10-02 21:43:28 +05:30

17 lines
238 B
C++

namespace Language
{
template <class T>
class Singleton
{
Singleton() {}
Singleton(Singleton &s) {}
Singleton& operator=(const Singleton&) {}
public:
static T* instance()
{
static T* obj = new T;
return obj;
}
};
}