// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #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