Created
February 18, 2016 04:46
-
-
Save sh0seo/da2743282a7ce19b2160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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