Created
November 16, 2015 19:00
-
-
Save simonlynen/180f291bcd5087b5bc17 to your computer and use it in GitHub Desktop.
Singleton with local static
This file contains hidden or 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 Singleton { | |
public: | |
static Singleton& Instance() { | |
static Singleton instance; | |
return instance; | |
} | |
private: | |
Singleton() = default; | |
~Singleton() = default; | |
Singleton(const Singleton&) = delete; | |
Singleton& operator=(const Singleton&) = delete; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment