35 template<
typename... Args>
37 if (!m_pInstance) [[unlikely]] {
38 m_pInstance =
new T(std::forward<Args>(args)...);
66 static T *m_pInstance;
A template class for creating singleton instances.
static T & getInstance(Args... args)
Gets the singleton instance of the class.
Singleton()
Protected constructor to prevent direct instantiation.
~Singleton()
Protected destructor to prevent direct deletion.