#ifndef Toolbox_Singleton_H #define Toolbox_Singleton_H namespace Toolbox { template class Singleton { public: static Derived *instance() { static Derived instance; return &instance; } Singleton(const Singleton &) = delete; Singleton &operator=(const Singleton &) = delete; protected: Singleton() = default; ~Singleton() = default; }; } #endif