From 34abd7157473c7697784daaed080bdecf51e4199 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 27 Mar 2018 14:20:21 +0200 Subject: [PATCH] LuaWrapper: Don't move function since we still access it later --- ext/luawrapper/include/LuaContext.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index abe432523b..6eb2e7b77f 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -1140,7 +1140,7 @@ private: static_assert(std::is_class::value || std::is_pointer::value || std::is_union::value , "registerFunction can only be used for a class a union or a pointer"); checkTypeRegistration(mState, &typeid(TObject)); - setTable(mState, Registry, &typeid(TObject), 0, functionName, std::move(function)); + setTable(mState, Registry, &typeid(TObject), 0, functionName, function); checkTypeRegistration(mState, &typeid(TObject*)); setTable(mState, Registry, &typeid(TObject*), 0, functionName, [=](TObject* obj, TOtherParams... rest) { assert(obj); return function(*obj, std::forward(rest)...); }); -- 2.47.3