#pragma once #include namespace Common { template class Singleton { public: static T* Instance() { if (!m_instance) { m_instance = std::make_unique(); } return m_instance.get(); } protected: Singleton(); ~Singleton(); private: static inline std::unique_ptr m_instance{}; }; } // namespace Common