Always inline OnScopeEnd constructor and destructor
This commit is contained in:
parent
ecabfc67b7
commit
4843643514
|
@ -106,7 +106,10 @@ template<typename T>
|
||||||
class OnScopeEnd
|
class OnScopeEnd
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
[[gnu::always_inline]]
|
||||||
OnScopeEnd(T func) : m_func(std::move(func)) {}
|
OnScopeEnd(T func) : m_func(std::move(func)) {}
|
||||||
|
|
||||||
|
[[gnu::always_inline]]
|
||||||
~OnScopeEnd() { m_func(); }
|
~OnScopeEnd() { m_func(); }
|
||||||
private:
|
private:
|
||||||
T m_func;
|
T m_func;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user