36 template <
typename TType>
44 static inline std::unique_ptr<TType> _instance =
nullptr;
50 throw std::runtime_error(
"Instance not yet created.");
52 return _instance.get();
55 template <
typename... TArgs>
58 if (_instance !=
nullptr)
59 throw std::runtime_error(
"Instance already exists.");
61 _instance = std::make_unique<TType>((p_args)...);
Singleton Design Pattern.
static TType * instance()
static void instantiate(TArgs... p_args)