Additional get_call argument that defaults index to 1 (first argument of stack).

tuple_types had overlapping purpose: we should split it up soon
This commit is contained in:
ThePhD 2014-05-30 18:21:19 -04:00
parent 61ecd1c87e
commit 854d735410
2 changed files with 7 additions and 2 deletions

View File

@ -298,6 +298,11 @@ inline auto get_call(lua_State* L, int index, TFx&& fx, types<Args...> t) -> dec
return detail::ltr_get(L, index, std::forward<TFx>(fx), t, t);
}
template<typename... Args, typename TFx>
inline auto get_call(lua_State* L, TFx&& fx, types<Args...> t) -> decltype(detail::ltr_get(L, 1, std::forward<TFx>(fx), t, t)) {
return detail::ltr_get(L, 1, std::forward<TFx>(fx), t, t);
}
template<typename... Args, typename TFx>
inline auto pop_call(lua_State* L, TFx&& fx, types<Args...> t) -> decltype(detail::ltr_pop(L, std::forward<TFx>(fx), t, t)) {
return detail::ltr_pop(L, std::forward<TFx>(fx), t, t);

View File

@ -57,7 +57,7 @@ template<size_t... Ns>
struct build_reverse_indices<0, Ns...> : indices<Ns...> {};
template<typename... Args>
struct types : build_indices<sizeof...(Args)> { typedef types type; };
struct types : build_indices<sizeof...(Args)> { typedef types type; typedef types types_type; };
template<class Acc, class... Args>
struct reversed_ : Acc{};
@ -81,4 +81,4 @@ const auto default_constructor = constructors<types<>>{};
} // sol
#endif // SOL_TUPLE_HPP
#endif // SOL_TUPLE_HPP