You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
325 B
C
21 lines
325 B
C
7 months ago
|
#ifndef SINGLETON_H
|
||
|
#define SINGLETON_H
|
||
|
|
||
|
template <class T>
|
||
|
class Singleton {
|
||
|
public:
|
||
|
|
||
|
static T& getInstance() {
|
||
|
static T instance;
|
||
|
return instance;
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
Singleton();
|
||
|
~Singleton();
|
||
|
Singleton(Singleton const&);
|
||
|
Singleton& operator=(Singleton const&);
|
||
|
};
|
||
|
|
||
|
#endif // SINGLETON_H
|