initialize repository of design pattern template

This commit is contained in:
LU
2025-08-09 08:41:14 +08:00
commit 1727e31b9d
32 changed files with 2149 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "singleton.hpp"
SingletonA* SingletonA::m_pInstance = nullptr;
SingletonA* SingletonA::getInstance()
{
if (m_pInstance == nullptr)
{
m_pInstance = new SingletonA();
}
return m_pInstance;
}
SingletonB* SingletonB::getInstance()
{
static SingletonB Instance;
return &Instance;
}