danicoin/src/mnemonics/singleton.h

17 lines
238 B
C
Raw Normal View History

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;
}
};
}