From 48436435140adf4cf502abd53316e9c4242ac5f2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 11 Mar 2015 20:52:39 +0000 Subject: [PATCH] Always inline OnScopeEnd constructor and destructor --- src/utils.hh | 3 +++ 1 file changed, 3 insertions(+) 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;