This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Tortuga/client/singleton.hpp
T
2013-05-12 02:33:08 +10:00

32 lines
483 B
C++

#ifndef SINGLETON_HPP_
#define SINGLETON_HPP_
/*
template<typename T>
class Singleton {
public:
static T* GetSingletonPtr() {
return &singleton;
}
static T& GetSingletonRef() {
return singleton;
}
private:
Singleton();
~Singleton();
Singleton(const Singleton&);
Singleton& operator=(const Singleton&);
Singleton(Singleton&&);
Singleton& operator=(Singleton&&);
static T singleton;
};
*/
template<typename T>
T* GetSingletonPtr() {
static T t;
return &t;
}
#endif