58 #define QX_SINGLETON_S(T, specifiers) \
60 friend struct qx::singleton_traits<T>; \
64 qx::singleton_traits<T>::on_constructed(*this); \
68 qx::singleton_traits<T>::on_destructed(*this); \
70 T(const T&) = delete; \
72 const T& operator=(const T&) = delete; \
73 const T& operator=(T&&) = delete; \
76 static T& get_instance() \
78 specifiers T instance; \
79 qx::singleton_traits<T>::on_getter(instance); \
93 #define QX_SINGLETON(T) QX_SINGLETON_S(T, static)
static void on_getter(T &instance)
Called when singleton proceeds getter.
static void on_destructed(T &instance)
Called before singleton destructed.
static void on_constructed(T &instance)
Called when singleton constructed.