Advertisement
p1ayer

Singleton of C++

Sep 4th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1.     template <typename T>
  2.     class Singleton {
  3.     public:
  4.         Singleton() {}
  5.         virtual ~Singleton() {}
  6.  
  7.         static T* GetInstance() {
  8.             static T _Instance;
  9.             return &_Instance;
  10.         }
  11.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement