| 51 | |
| 52 | template <typename R = reference, bool should_pop = !is_stack_based_v<R>, typename T> |
| 53 | R make_reference_userdata(lua_State* L, T&& value) { |
| 54 | int backpedal = stack::push_userdata(L, std::forward<T>(value)); |
| 55 | R r = stack::get<R>(L, -backpedal); |
| 56 | if (should_pop) { |
| 57 | lua_pop(L, backpedal); |
| 58 | } |
| 59 | return r; |
| 60 | } |
| 61 | |
| 62 | template <typename T, typename R = reference, bool should_pop = !is_stack_based_v<R>, typename... Args> |
| 63 | R make_reference_userdata(lua_State* L, Args&&... args) { |
nothing calls this directly
no test coverage detected