Singleton.h
Upload User: zhoushen
Upload Date: 2022-06-15
Package Size: 84k
Code Size: 0k
Category:

Dialog_Window

Development Platform:

Visual C++

  1. //
  2. // Singleton.h
  3. //
  4. /////////////////////////////////////////////////////////////////////////////
  5. #if !defined(SINGLETON_H)
  6. #define SINGLETON_H
  7. #if _MSC_VER >= 1000
  8. #pragma once
  9. #endif 
  10. template <typename Obj>
  11. class SingletonObj 
  12. {
  13.      Obj m_Obj;
  14. public:
  15.     SingletonObj() {}  
  16. virtual ~SingletonObj() {}
  17. Obj& operator()() { return m_Obj; }
  18. };
  19. #endif