commit 6a3f12292de8f47e222e402782651bfaf9ea61e5 Author: lucaspalomodevelop Date: Tue Jul 18 16:14:38 2023 +0200 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff1fef1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +main.cpp +*.exe \ No newline at end of file diff --git a/lpstd.hpp b/lpstd.hpp new file mode 100644 index 0000000..db94ea7 --- /dev/null +++ b/lpstd.hpp @@ -0,0 +1,7 @@ + +#ifndef __LPSTD_HPP__ +#define __LPSTD_HPP__ + +#include "src/singleton.hpp" + +#endif // __LPSTD_HPP__ diff --git a/src/singleton.hpp b/src/singleton.hpp new file mode 100644 index 0000000..3b7e7df --- /dev/null +++ b/src/singleton.hpp @@ -0,0 +1,22 @@ + +namespace lpstd +{ + template + class Singleton + { + public: + static T &Instance() + { + static T _instance; + return _instance; + } + + protected: + Singleton() {} + ~Singleton() {} + + private: + Singleton(Singleton const &); + Singleton &operator=(Singleton const &); + }; +}