first commit

This commit is contained in:
lucaspalomodevelop 2023-07-18 16:14:38 +02:00
commit 6a3f12292d
3 changed files with 31 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
main.cpp
*.exe

7
lpstd.hpp Normal file
View File

@ -0,0 +1,7 @@
#ifndef __LPSTD_HPP__
#define __LPSTD_HPP__
#include "src/singleton.hpp"
#endif // __LPSTD_HPP__

22
src/singleton.hpp Normal file
View File

@ -0,0 +1,22 @@
namespace lpstd
{
template <typename T>
class Singleton
{
public:
static T &Instance()
{
static T _instance;
return _instance;
}
protected:
Singleton() {}
~Singleton() {}
private:
Singleton(Singleton const &);
Singleton &operator=(Singleton const &);
};
}