diff --git a/src/utils.hh b/src/utils.hh index d8c6c994..31fd0cdd 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -106,7 +106,10 @@ template class OnScopeEnd { public: + [[gnu::always_inline]] OnScopeEnd(T func) : m_func(std::move(func)) {} + + [[gnu::always_inline]] ~OnScopeEnd() { m_func(); } private: T m_func;