mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
19 lines
395 B
C
19 lines
395 B
C
|
#pragma once
|
||
|
|
||
|
template <typename T>
|
||
|
class Singleton {
|
||
|
public:
|
||
|
static T& Instance() {
|
||
|
static T instance{};
|
||
|
return instance;
|
||
|
}
|
||
|
|
||
|
virtual ~Singleton() = default;
|
||
|
Singleton(const Singleton& other) = delete;
|
||
|
Singleton(Singleton&& other) = delete;
|
||
|
Singleton& operator=(const Singleton& other) = delete;
|
||
|
Singleton& operator=(Singleton&& other) = delete;
|
||
|
|
||
|
protected:
|
||
|
Singleton() = default;
|
||
|
};
|