diff options
author | chai <chaifix@163.com> | 2018-07-23 18:57:50 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-23 18:57:50 +0800 |
commit | 128b6dd3e3a803e475ec03493ee26e6b20d7e42b (patch) | |
tree | 2dece2011db239c7ebee2786c9978e5636ea4947 /src/libjin/common/singleton.h | |
parent | a4c51a4ac6dc263c3ea2cd49afbd3fbad9ccea17 (diff) |
update
Signed-off-by: chai <chaifix@163.com>
Diffstat (limited to 'src/libjin/common/singleton.h')
-rw-r--r-- | src/libjin/common/singleton.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libjin/common/singleton.h b/src/libjin/common/singleton.h index e6326b2..a6c7d6d 100644 --- a/src/libjin/common/singleton.h +++ b/src/libjin/common/singleton.h @@ -21,7 +21,7 @@ namespace jin protected: Singleton() {}; virtual ~Singleton() {}; - private: + private: Singleton(const Singleton&); Singleton& operator = (const Singleton&); @@ -29,6 +29,10 @@ namespace jin }; template<class T> T* Singleton<T>::_instance = nullptr; + +#define SINGLETON(T) \ + friend Singleton<T> + } #endif
\ No newline at end of file |