feat:data slove and update heatmap
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
|
||||
namespace creeper::util {
|
||||
|
||||
template <typename T> class Singleton {
|
||||
public:
|
||||
static T& instance();
|
||||
|
||||
Singleton(const Singleton&) = delete;
|
||||
Singleton& operator=(const Singleton&) = delete;
|
||||
|
||||
protected:
|
||||
struct token { };
|
||||
Singleton() = default;
|
||||
};
|
||||
|
||||
template <typename T> inline T& Singleton<T>::instance() {
|
||||
static const std::unique_ptr<T> instance { new T { token {} } };
|
||||
return *instance;
|
||||
}
|
||||
|
||||
}
|
||||
#pragma once
|
||||
#include <memory>
|
||||
|
||||
namespace creeper::util {
|
||||
|
||||
template <typename T> class Singleton {
|
||||
public:
|
||||
static T& instance();
|
||||
|
||||
Singleton(const Singleton&) = delete;
|
||||
Singleton& operator=(const Singleton&) = delete;
|
||||
|
||||
protected:
|
||||
struct token { };
|
||||
Singleton() = default;
|
||||
};
|
||||
|
||||
template <typename T> inline T& Singleton<T>::instance() {
|
||||
static const std::unique_ptr<T> instance { new T { token {} } };
|
||||
return *instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user