Seaside/SpyCustom/Singleton.hpp
2021-06-16 18:43:45 +03:00

29 lines
449 B
C++

#ifndef SINGLETON
#define SINGLETON
#pragma once
template<typename T>
class Singleton
{
protected:
Singleton() {}
~Singleton() {}
Singleton(const Singleton&) = delete;
Singleton& operator=(const Singleton&) = delete;
Singleton(Singleton&&) = delete;
Singleton& operator=(Singleton&&) = delete;
public:
static T& Get()
{
static T inst{};
return inst;
}
};
#endif