From 7bf73b589683f195e119eddb6adb56fc607cef4e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 2 Apr 2013 14:03:22 +0200 Subject: [PATCH] OnScopeEnd: move parameter instead of copying it --- src/utils.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.hh b/src/utils.hh index 0e155a37..bd52bf0c 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -196,7 +196,7 @@ template class OnScopeEnd { public: - OnScopeEnd(T func) : m_func(func) {} + OnScopeEnd(T func) : m_func(std::move(func)) {} ~OnScopeEnd() { m_func(); } private: T m_func;