mirror of
https://github.com/lucaspalomodevelop/lpstd.git
synced 2026-03-12 23:27:22 +00:00
first commit
This commit is contained in:
commit
6a3f12292d
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
main.cpp
|
||||
*.exe
|
||||
7
lpstd.hpp
Normal file
7
lpstd.hpp
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#ifndef __LPSTD_HPP__
|
||||
#define __LPSTD_HPP__
|
||||
|
||||
#include "src/singleton.hpp"
|
||||
|
||||
#endif // __LPSTD_HPP__
|
||||
22
src/singleton.hpp
Normal file
22
src/singleton.hpp
Normal 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 &);
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user