From 45000177c3f731318cd0c4794095e555343b3d1c Mon Sep 17 00:00:00 2001 From: ThePhD Date: Mon, 2 Dec 2013 21:39:21 -0500 Subject: [PATCH] Alright, this should fix the GCC build errors! Everything should work as advertised. A Sol for the Mun: go, go! --- sol/function.hpp | 4 +--- sol/stack.hpp | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sol/function.hpp b/sol/function.hpp index d77bf480..f3d87485 100644 --- a/sol/function.hpp +++ b/sol/function.hpp @@ -32,10 +32,8 @@ private: template std::tuple call( types, std::size_t n ) { - typedef typename std::decay)>::type maketuple_t; - maketuple_t m = &std::make_tuple; lua_pcall( state( ), n, sizeof...( Ret ), 0 ); - return stack::pop_call( state( ), m, types() ); + return stack::pop_call( state( ), std::make_tuple, types( ) ); } template diff --git a/sol/stack.hpp b/sol/stack.hpp index c0d262ba..16b019fc 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -159,17 +159,20 @@ inline void push(lua_State* L, indices, const T& tuplen) { void(swallow{ '\0', (sol::stack::push(L, std::get(tuplen)), '\0')... }); } -template -auto ltr_pop(T&&, F&& f, types<>, Vs&&... vs) - -> decltype(f(std::forward(vs)...)) { - return f(std::forward(vs)...); +template +auto ltr_pop( lua_State*, F&& f, types<>, Vs&&... vs ) +-> decltype( f( std::forward( vs )... ) ) { + return f( std::forward( vs )... ); } - -// take head, produce value from it, pass after other values -template -auto ltr_pop(lua_State* L, F&& f, types, Vs&&... vs) --> decltype(ltr_pop(L, std::forward(f), types(), std::forward(vs)..., pop(L))) { - return ltr_pop(L, std::forward(f), types(), std::forward(vs)..., pop(L)); +template +auto ltr_pop( lua_State* L, F&& f, types, Vs&&... vs ) +-> decltype( ltr_pop( L, std::forward( f ), types<>( ), std::forward( vs )..., pop( L ) ) ) { + return ltr_pop( L, std::forward( f ), types<>( ), std::forward( vs )..., pop( L ) ); +} +template +auto ltr_pop( lua_State* L, F&& f, types, Vs&&... vs ) +-> decltype( ltr_pop( L, std::forward( f ), types( ), std::forward( vs )..., pop( L ) ) ) { + return ltr_pop( L, std::forward( f ), types( ), std::forward( vs )..., pop( L ) ); } } // detail