16 lines
240 B
C++
16 lines
240 B
C++
//
|
|
// 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; }
|