mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
20 lines
396 B
C
20 lines
396 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;
|
||
|
};
|