diff --git a/sol/stack.hpp b/sol/stack.hpp index c4c9fc13..375f1819 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -107,7 +107,8 @@ inline bool get_helper(std::true_type, lua_State* L, int index) { } template -inline auto get_helper(std::false_type, lua_State* L, int index = -1) { +inline auto get_helper(std::false_type, lua_State* L, int index = -1) +-> decltype(get(types(), L, index)) { // T is a class return get(types(), L, index); } diff --git a/sol/types.hpp b/sol/types.hpp index 7c448910..6d17468b 100644 --- a/sol/types.hpp +++ b/sol/types.hpp @@ -85,16 +85,6 @@ class function; class object; namespace detail { -template -inline type arithmetic(std::true_type) { - return type::number; -} - -template -inline type arithmetic(std::false_type) { - return usertype(is_specialization_of{}); -} - template inline type usertype(std::true_type) { return type::userdata; @@ -104,6 +94,16 @@ template inline type usertype(std::false_type) { return type::none; } + +template +inline type arithmetic(std::true_type) { + return type::number; +} + +template +inline type arithmetic(std::false_type) { + return usertype(is_specialization_of{}); +} } // detail template