diff --git a/sol/function_types_member.hpp b/sol/function_types_member.hpp index 7c0dec3f..ffc59f79 100644 --- a/sol/function_types_member.hpp +++ b/sol/function_types_member.hpp @@ -36,8 +36,12 @@ struct functor_function : public base_function { template functor_function(Args&&... args): fx(std::forward(args)...) {} + int call(lua_State* L) { + return stack::call_into_lua(meta::tuple_types(), args_types(), fx, L, 1); + } + virtual int operator()(lua_State* L) override { - auto f = [&](lua_State* L) -> int { return stack::call_into_lua(meta::tuple_types(), args_types(), fx, L, 1);}; + auto f = [&](lua_State* L) -> int { return this->call(L);}; return detail::trampoline(L, f); } }; @@ -64,8 +68,12 @@ struct member_function : public base_function { template member_function(Tm&& m, Args&&... args): fx(std::forward(m), std::forward(args)...) {} + int call(lua_State* L) { + return stack::call_into_lua(meta::tuple_types(), args_types(), fx, L, 1); + } + virtual int operator()(lua_State* L) override { - auto f = [&](lua_State* L) -> int { return stack::call_into_lua(meta::tuple_types(), args_types(), fx, L, 1);}; + auto f = [&](lua_State* L) -> int { return this->call(L);}; return detail::trampoline(L, f); } };