initialize repository of design pattern template
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user