feat : 3.9.7.29
This commit is contained in:
1 parent
9f2b0f9925
commit
2767576351
38 files changed
+18059
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#ifndef BASE_SINGLETON_H_
|
||||
#define BASE_SINGLETON_H_
|
||||
namespace base {
|
||||
template <typename T>
|
||||
class Singleton {
|
||||
protected:
|
||||
Singleton() {}
|
||||
~Singleton() {}
|
||||
|
||||
Singleton(const Singleton&) = delete;
|
||||
Singleton& operator=(const Singleton&) = delete;
|
||||
|
||||
Singleton(Singleton&&) = delete;
|
||||
Singleton& operator=(Singleton&&) = delete;
|
||||
|
||||
public:
|
||||
static T& GetInstance() {
|
||||
static T instance{};
|
||||
return instance;
|
||||
}
|
||||
};
|
||||
} // namespace base
|
||||
#endif
|
||||
Reference in new issue
Block a user