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
{
public:
OnScopeEnd(T func) : m_func(func) {}
OnScopeEnd(T func) : m_func(std::move(func)) {}
~OnScopeEnd() { m_func(); }
private:
T m_func;