Files
ai_sdk/src/util/Singleton.h

19 lines
333 B
C++

#ifndef SINGLETON_H
#define SINGLETON_H
template <typename T>
class Singleton {
public:
static T& GetInstance() {
static T instance;
return instance;
}
Singleton(const Singleton&) = delete;
Singleton& operator=(const Singleton&) = delete;
protected:
Singleton() {}
~Singleton() {}
};
#endif