重构
This commit is contained in:
1 parent
384aade1a8
commit
bfe5b0ee12
82 files changed
+11652
-3978
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#ifndef WXHELPER_SINGLETON_H_
|
||||
#define WXHELPER_SINGLETON_H_
|
||||
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;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
Reference in new issue
Block a user