mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
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:
parent
61ecd1c87e
commit
854d735410
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user