From: Remi Gacogne Date: Tue, 27 Mar 2018 12:20:21 +0000 (+0200) Subject: LuaWrapper: Don't move function since we still access it later X-Git-Tag: dnsdist-1.3.0~7^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34abd7157473c7697784daaed080bdecf51e4199;p=thirdparty%2Fpdns.git LuaWrapper: Don't move function since we still access it later --- 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)...); });