1
1
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:
Maxime Coste 2013-04-02 14:03:22 +02:00
parent e2d64b01d5
commit 7bf73b5896

View File

@ -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;