X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsingleton.h;h=1bf68a2ac7aee74c090b28e00965a29232820432;hp=a3c96524e9f230703192b0ddad2c00af7046fb2a;hb=c1cf157116de7fc3da96203aa6f03c38c7ebb650;hpb=30b159cb876a9495de42e9a3e70ca050516f0805 diff --git a/src/common/singleton.h b/src/common/singleton.h index a3c96524..1bf68a2a 100644 --- a/src/common/singleton.h +++ b/src/common/singleton.h @@ -40,9 +40,9 @@ namespace detail { // We need to export the function on anything not using Windows DLLs, otherwise local static members don't // work across library boundaries. template -QUASSEL_SINGLETON_EXPORT T *getOrSetInstance(T *instance = nullptr, bool destroyed = false) +QUASSEL_SINGLETON_EXPORT T* getOrSetInstance(T* instance = nullptr, bool destroyed = false) { - static T *_instance = instance; + static T* _instance = instance; static bool _destroyed = destroyed; if (destroyed) { @@ -93,16 +93,16 @@ public: * * @param instance Pointer to the instance being created, i.e. the 'this' pointer of the parent class */ - Singleton(T *instance) + Singleton(T* instance) { detail::getOrSetInstance(instance); } // Satisfy Rule of Five - Singleton(const Singleton &) = delete; - Singleton(Singleton &&) = delete; - Singleton &operator=(const Singleton &) = delete; - Singleton &operator=(Singleton &&) = delete; + Singleton(const Singleton&) = delete; + Singleton(Singleton&&) = delete; + Singleton& operator=(const Singleton&) = delete; + Singleton& operator=(Singleton&&) = delete; /** * Destructor. @@ -122,7 +122,7 @@ public: * * @returns A pointer to the instance */ - static T *instance() + static T* instance() { return detail::getOrSetInstance(); }