diff --git a/include/td/misc/SlotGuard.h b/include/td/misc/SlotGuard.h index 3ade4ff..934b891 100644 --- a/include/td/misc/SlotGuard.h +++ b/include/td/misc/SlotGuard.h @@ -5,11 +5,18 @@ namespace td { namespace utils { +/** + * \brief Wrapper class to automatically disconnect from a Signal on object destruction + * \sa Signal + */ class SlotGuard { private: std::vector> m_Deleters; public: + /** + * \brief Connect a signal to a function (with the same signature) + */ template void Connect(Signal& a_Signal, const typename Signal::CallBack& a_Callback) { a_Signal.Connect(a_Callback);