Advertisement
Guest User

Untitled

a guest
May 26th, 2015
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. class MyConfigSingleton : public Singleton
  2. {
  3.    MyConfigSingleton()   { /*get fileName*/ plog::init(fileName/*, ...*/); LOGD << "Created."; }
  4.    ~MyConfigSingleton() { LOGD << "Fail."; }
  5.    
  6.    void doNothing() const {LOGD << "Doing nothing";}
  7. };
  8.  
  9. int main()
  10. {
  11.     // init order - MyConfigSingleton::MyConfigSingleton (), Logger::Logger()
  12.     MyConfigSingleton::getInstance()->doNothing();
  13.  
  14.     // deinit order: Logger::~Logger(), MyConfigSingleton::~MyConfigSingleton()
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement