0%

singleton

singleton

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