Dribble/cpp/localization/Singleton.h

21 lines
325 B
C
Raw Normal View History

2024-05-06 19:33:33 +08:00
#ifndef SINGLETON_H
#define SINGLETON_H
template <class T>
class Singleton {
public:
static T& getInstance() {
static T instance;
return instance;
}
private:
Singleton();
~Singleton();
Singleton(Singleton const&);
Singleton& operator=(Singleton const&);
};
#endif // SINGLETON_H