Advertisement
rockdrilla

Meyer's Singleton

Jul 22nd, 2015
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. class Singleton final {
  2. private:
  3.     Singleton() {
  4.         // ... constructor
  5.     }
  6.  
  7.     ~Singleton() {
  8.         // ... destructor
  9.     }
  10.  
  11.     // ... instance members
  12.  
  13. public:
  14.     static Singleton& instance() { static Singleton _x; return _x; }
  15.  
  16.     // ... instance members
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement