Always inline OnScopeEnd constructor and destructor

This commit is contained in:
Maxime Coste 2015-03-11 20:52:39 +00:00
parent ecabfc67b7
commit 4843643514

View File

@ -106,7 +106,10 @@ template<typename T>
class OnScopeEnd
{
public:
[[gnu::always_inline]]
OnScopeEnd(T func) : m_func(std::move(func)) {}
[[gnu::always_inline]]
~OnScopeEnd() { m_func(); }
private:
T m_func;