26 lines
328 B
C++
26 lines
328 B
C++
#ifndef AEON_SINGLETON_H_
|
|
#define AEON_SINGLETON_H_
|
|
|
|
namespace Helpers
|
|
{
|
|
|
|
template <class T>
|
|
class Singleton
|
|
{
|
|
public:
|
|
static T& GetInstance()
|
|
{
|
|
static T instance;
|
|
return instance;
|
|
}
|
|
|
|
Singleton( Singleton const& ) = delete;
|
|
void operator=( Singleton const& ) = delete;
|
|
protected:
|
|
Singleton() = default;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|