| 15174 | template <bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename Ret0, typename... Ret, typename... Args, |
| 15175 | typename Fx, typename... FxArgs> |
| 15176 | inline int call_into_lua(types<Ret0, Ret...> tr, types<Args...> ta, lua_State* L, int start, Fx&& fx, FxArgs&&... fxargs) { |
| 15177 | if constexpr (std::is_void_v<Ret0>) { |
| 15178 | call<check_args>(tr, ta, L, start, std::forward<Fx>(fx), std::forward<FxArgs>(fxargs)...); |
| 15179 | if constexpr (clean_stack) { |
| 15180 | lua_settop(L, 0); |
| 15181 | } |
| 15182 | return 0; |
| 15183 | } |
| 15184 | else { |
| 15185 | (void)tr; |
| 15186 | decltype(auto) r |
| 15187 | = call<check_args>(types<meta::return_type_t<Ret0, Ret...>>(), ta, L, start, std::forward<Fx>(fx), std::forward<FxArgs>(fxargs)...); |
| 15188 | using R = meta::unqualified_t<decltype(r)>; |
| 15189 | using is_stack = meta::any<is_stack_based<R>, std::is_same<R, absolute_index>, std::is_same<R, ref_index>, std::is_same<R, raw_index>>; |
| 15190 | if constexpr (clean_stack && !is_stack::value) { |
| 15191 | lua_settop(L, 0); |
| 15192 | } |
| 15193 | return push_reference(L, std::forward<decltype(r)>(r)); |
| 15194 | } |
| 15195 | } |
| 15196 | |
| 15197 | template <bool check_args = detail::default_safe_function_calls, bool clean_stack = true, typename Fx, typename... FxArgs> |
| 15198 | inline int call_lua(lua_State* L, int start, Fx&& fx, FxArgs&&... fxargs) { |
no test coverage detected