Files
CPP_Core/psc_global_include/Singleton.hpp
T
2026-07-23 12:27:07 +08:00

17 lines
354 B
C++

#pragma once
namespace Psc {
template<typename Derived>
class Singleton {
public:
static Derived *instance() {
static Derived instance;
return &instance;
}
Singleton(const Singleton &) = delete;
Singleton &operator=(const Singleton &) = delete;
protected:
Singleton() = default;
~Singleton() = default;
};
}