mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-28 01:00:28 +03:00
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