Skip to content

Instantly share code, notes, and snippets.

@sh0seo
Created February 18, 2016 04:46
Show Gist options
  • Save sh0seo/da2743282a7ce19b2160 to your computer and use it in GitHub Desktop.
Save sh0seo/da2743282a7ce19b2160 to your computer and use it in GitHub Desktop.
class DynamicSingleton
{
public:
static DynamicSingleton* GetInstance()
{
if (instance_ == NULL)
{
instance_ = new DynamicSingleton();
}
return instance_;
}
private:
DynamicSingleton() {};
DynamicSingleton(const DynamicSingleton& other);
~DynamicSingleton() {};
static DynamicSingleton* instance_;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment