// // Created by light on 20-2-6. // class singleton { private: singleton() {} static singleton *p; public: static singleton *instance(); }; singleton *singleton::p = new singleton(); singleton *singleton::instance() { return p; }