mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Move ltr_pop down, so that GCC can see the right instantiations of the functions it needs.
This commit is contained in:
parent
bf2404bdfd
commit
17ec059c32
@ -36,19 +36,6 @@ using DisableIf = typename std::enable_if<!T::value, R>::type;
|
|||||||
|
|
||||||
namespace stack {
|
namespace stack {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<class T, class F, class... Vs>
|
|
||||||
auto ltr_pop(T&& extra, F f, types<>, Vs&&... vs)
|
|
||||||
-> decltype(f(std::forward<Vs>(vs)...)) {
|
|
||||||
return f(std::forward<Vs>(vs)...);
|
|
||||||
}
|
|
||||||
|
|
||||||
// take head, produce value from it, pass after other values
|
|
||||||
template<class F, class Head, class... Tail, class... Vs>
|
|
||||||
auto ltr_pop(lua_State* L, F f, types<Head, Tail...>, Vs&&... vs)
|
|
||||||
-> decltype(ltr_pop(L, f, types<Tail...>{}, std::forward<Vs>(vs)..., pop<Head>(L))) {
|
|
||||||
return ltr_pop(L, f, types<Tail...>{}, std::forward<Vs>(vs)..., pop<Head>(L));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline T get_unsigned(lua_State* L, std::true_type, int index = -1) {
|
inline T get_unsigned(lua_State* L, std::true_type, int index = -1) {
|
||||||
return lua_tounsigned(L, index);
|
return lua_tounsigned(L, index);
|
||||||
@ -171,6 +158,20 @@ inline void push(lua_State* L, indices<I...>, const T& tuplen) {
|
|||||||
using swallow = char [];
|
using swallow = char [];
|
||||||
void(swallow{ '\0', (sol::stack::push(L, std::get<I>(tuplen)), '\0')... });
|
void(swallow{ '\0', (sol::stack::push(L, std::get<I>(tuplen)), '\0')... });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class T, class F, class... Vs>
|
||||||
|
auto ltr_pop(T&& extra, F f, types<>, Vs&&... vs)
|
||||||
|
-> decltype(f(std::forward<Vs>(vs)...)) {
|
||||||
|
return f(std::forward<Vs>(vs)...);
|
||||||
|
}
|
||||||
|
|
||||||
|
// take head, produce value from it, pass after other values
|
||||||
|
template<class F, class Head, class... Tail, class... Vs>
|
||||||
|
auto ltr_pop(lua_State* L, F f, types<Head, Tail...>, Vs&&... vs)
|
||||||
|
-> decltype(ltr_pop(L, f, types<Tail...>{}, std::forward<Vs>(vs)..., pop<Head>(L))) {
|
||||||
|
return ltr_pop(L, f, types<Tail...>{}, std::forward<Vs>(vs)..., pop<Head>(L));
|
||||||
|
}
|
||||||
|
|
||||||
} // detail
|
} // detail
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user