Add shadows, fi other stuff
This commit is contained in:
30
project/src/Singleton.h
Normal file
30
project/src/Singleton.h
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Created by Bram on 16/01/2025.
|
||||
//
|
||||
|
||||
#ifndef GP1_DIRECTX_SINGLETON_H
|
||||
#define GP1_DIRECTX_SINGLETON_H
|
||||
|
||||
template<typename T>
|
||||
class Singleton {
|
||||
public:
|
||||
static T &GetInstance() {
|
||||
static T instance{};
|
||||
return instance;
|
||||
}
|
||||
|
||||
virtual ~Singleton() = default;
|
||||
|
||||
Singleton(Singleton &&other) = delete;
|
||||
|
||||
Singleton(const Singleton &other) = delete;
|
||||
|
||||
Singleton &operator=(Singleton &&other) = delete;
|
||||
|
||||
Singleton &operator=(const Singleton &other) = delete;
|
||||
|
||||
protected:
|
||||
Singleton() = default;
|
||||
};
|
||||
|
||||
#endif //GP1_DIRECTX_SINGLETON_H
|
||||
Reference in New Issue
Block a user