This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
2020-08-04 13:13:01 -04:00

21 lines
378 B
C++

#pragma once
template <typename T>
class singleton {
protected:
singleton() {}
~singleton() {}
singleton(const singleton&) = delete;
singleton& operator=(const singleton&) = delete;
singleton(singleton&&) = delete;
singleton& operator=(singleton&&) = delete;
public:
static T& get() {
static T inst{};
return inst;
}
};