0%

singleton

singleton

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Singleton{
public:
static Singleton& getInstance(){
static Singleton instance;
return instance;
}
private:
Singleton() = default;
~Singleton() = default;
Singleton(const Singleton&) = delete;
Singleton(Singleton&&) = delete;
void operator=(const Singleton&) = delete;
void operator=(Singleton&&) = delete;
}