mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Alright, this should fix the GCC build errors! Everything should work as advertised. A Sol for the Mun: go, go!
This commit is contained in:
parent
86b16dc61b
commit
45000177c3
|
@ -32,10 +32,8 @@ private:
|
||||||
|
|
||||||
template <typename... Ret>
|
template <typename... Ret>
|
||||||
std::tuple<Ret...> call( types<Ret...>, std::size_t n ) {
|
std::tuple<Ret...> call( types<Ret...>, std::size_t n ) {
|
||||||
typedef typename std::decay<decltype(std::make_tuple<Ret...>)>::type maketuple_t;
|
|
||||||
maketuple_t m = &std::make_tuple<Ret...>;
|
|
||||||
lua_pcall( state( ), n, sizeof...( Ret ), 0 );
|
lua_pcall( state( ), n, sizeof...( Ret ), 0 );
|
||||||
return stack::pop_call( state( ), m, types<Ret...>() );
|
return stack::pop_call( state( ), std::make_tuple<Ret...>, types<Ret...>( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Ret>
|
template <typename Ret>
|
||||||
|
|
|
@ -159,17 +159,20 @@ inline void push(lua_State* L, indices<I...>, const T& tuplen) {
|
||||||
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>
|
template<typename F, typename... Vs>
|
||||||
auto ltr_pop(T&&, F&& f, types<>, Vs&&... vs)
|
auto ltr_pop( lua_State*, F&& f, types<>, Vs&&... vs )
|
||||||
-> decltype(f(std::forward<Vs>(vs)...)) {
|
-> decltype( f( std::forward<Vs>( vs )... ) ) {
|
||||||
return f(std::forward<Vs>(vs)...);
|
return f( std::forward<Vs>( vs )... );
|
||||||
}
|
}
|
||||||
|
template<typename F, typename Head, typename... Vs>
|
||||||
// take head, produce value from it, pass after other values
|
auto ltr_pop( lua_State* L, F&& f, types<Head>, Vs&&... vs )
|
||||||
template<class F, class Head, class... Tail, class... Vs>
|
-> decltype( ltr_pop( L, std::forward<F>( f ), types<>( ), std::forward<Vs>( vs )..., pop<Head>( L ) ) ) {
|
||||||
auto ltr_pop(lua_State* L, F&& f, types<Head, Tail...>, Vs&&... vs)
|
return ltr_pop( L, std::forward<F>( f ), types<>( ), std::forward<Vs>( vs )..., pop<Head>( L ) );
|
||||||
-> decltype(ltr_pop(L, std::forward<F>(f), types<Tail...>(), std::forward<Vs>(vs)..., pop<Head>(L))) {
|
}
|
||||||
return ltr_pop(L, std::forward<F>(f), types<Tail...>(), std::forward<Vs>(vs)..., pop<Head>(L));
|
template<typename F, typename Head, typename... Tail, typename... Vs>
|
||||||
|
auto ltr_pop( lua_State* L, F&& f, types<Head, Tail...>, Vs&&... vs )
|
||||||
|
-> decltype( ltr_pop( L, std::forward<F>( f ), types<Tail...>( ), std::forward<Vs>( vs )..., pop<Head>( L ) ) ) {
|
||||||
|
return ltr_pop( L, std::forward<F>( f ), types<Tail...>( ), std::forward<Vs>( vs )..., pop<Head>( L ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // detail
|
} // detail
|
||||||
|
|
Loading…
Reference in New Issue
Block a user