mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
21 lines
290 B
C++
21 lines
290 B
C++
#ifndef __MLX_SINGLETON__
|
|
#define __MLX_SINGLETON__
|
|
|
|
#include <Utils/NonCopyable.h>
|
|
|
|
namespace mlx
|
|
{
|
|
template <typename T>
|
|
class Singleton : public NonCopyable
|
|
{
|
|
public:
|
|
inline static T& Get()
|
|
{
|
|
static T instance;
|
|
return instance;
|
|
}
|
|
};
|
|
}
|
|
|
|
#endif // __MLX_SINGLETON__
|