diff options
Diffstat (limited to 'include/util/Singleton.hpp')
-rwxr-xr-x | include/util/Singleton.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/util/Singleton.hpp b/include/util/Singleton.hpp index 80ab5e8..de43dbe 100755 --- a/include/util/Singleton.hpp +++ b/include/util/Singleton.hpp @@ -12,12 +12,15 @@ #define DECLARE_SINGLETON( T ) \ friend class Singleton< T >; \ friend class scopedPtr< T >; + +#define DEFINE_SINGLETON( T ) \ + template class Singleton< T >; template< class T > class Singleton : private noncopyable { public: - UTIL_DLL_VISIBLE static T& instance( ) + static UTIL_DLL_VISIBLE T& instance( ) { if( destroyed ) { onDeadReference( ); |