OnScopeEnd: move parameter instead of copying it
This commit is contained in:
parent
e2d64b01d5
commit
7bf73b5896
|
@ -196,7 +196,7 @@ template<typename T>
|
||||||
class OnScopeEnd
|
class OnScopeEnd
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OnScopeEnd(T func) : m_func(func) {}
|
OnScopeEnd(T func) : m_func(std::move(func)) {}
|
||||||
~OnScopeEnd() { m_func(); }
|
~OnScopeEnd() { m_func(); }
|
||||||
private:
|
private:
|
||||||
T m_func;
|
T m_func;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user