From 854d735410a9e7d9b7d7f272a03f74d995b1d877 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Fri, 30 May 2014 18:21:19 -0400 Subject: [PATCH] Additional get_call argument that defaults index to 1 (first argument of stack). tuple_types had overlapping purpose: we should split it up soon --- sol/stack.hpp | 5 +++++ sol/tuple.hpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sol/stack.hpp b/sol/stack.hpp index 4f8838c2..ae8f561f 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -298,6 +298,11 @@ inline auto get_call(lua_State* L, int index, TFx&& fx, types t) -> dec return detail::ltr_get(L, index, std::forward(fx), t, t); } +template +inline auto get_call(lua_State* L, TFx&& fx, types t) -> decltype(detail::ltr_get(L, 1, std::forward(fx), t, t)) { + return detail::ltr_get(L, 1, std::forward(fx), t, t); +} + template inline auto pop_call(lua_State* L, TFx&& fx, types t) -> decltype(detail::ltr_pop(L, std::forward(fx), t, t)) { return detail::ltr_pop(L, std::forward(fx), t, t); diff --git a/sol/tuple.hpp b/sol/tuple.hpp index d73783cb..d2b766bc 100644 --- a/sol/tuple.hpp +++ b/sol/tuple.hpp @@ -57,7 +57,7 @@ template struct build_reverse_indices<0, Ns...> : indices {}; template -struct types : build_indices { typedef types type; }; +struct types : build_indices { typedef types type; typedef types types_type; }; template struct reversed_ : Acc{}; @@ -81,4 +81,4 @@ const auto default_constructor = constructors>{}; } // sol -#endif // SOL_TUPLE_HPP +#endif // SOL_TUPLE_HPP