Created
January 24, 2020 12:46
-
-
Save amigo421/e165c9012439fb7a277cd094d7978ef7 to your computer and use it in GitHub Desktop.
singleton template
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
| template <typename T> class singleton { | |
| void operator=(T const &) = delete; | |
| singleton(T const &) = delete; | |
| public: | |
| static T &get_instance() { | |
| static T inst; | |
| return inst; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment