diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-29 21:16:15 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-29 21:16:15 +0400 |
commit | 6249432407af8730c10bccc7894c0725fcaf5e47 (patch) | |
tree | 3ac1f094b9fdc199b04bc5ef209ce00e3596e37d /mert/Singleton.h | |
parent | 59bd7deb4b6b9c4f7b3b7dbb055783528fbc31ca (diff) |
beautify
Diffstat (limited to 'mert/Singleton.h')
-rw-r--r-- | mert/Singleton.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mert/Singleton.h b/mert/Singleton.h index 473517170..f50925fa4 100644 --- a/mert/Singleton.h +++ b/mert/Singleton.h @@ -5,13 +5,14 @@ namespace MosesTuning { - + // thread *un*safe singleton. // TODO: replace this with thread-safe singleton. template <typename T> -class Singleton { - public: +class Singleton +{ +public: static T* GetInstance() { if (m_instance == NULL) { m_instance = new T; @@ -26,7 +27,7 @@ class Singleton { } } - private: +private: Singleton(); static T* m_instance; }; |