Merge pull request #20 from ThePhD/master

Fixing some basic bugs MSVC didn't catch
This commit is contained in:
Danny 2014-05-09 20:00:18 -04:00
commit 559a77564e
2 changed files with 12 additions and 11 deletions

View File

@ -107,7 +107,8 @@ inline bool get_helper<bool>(std::true_type, lua_State* L, int index) {
}
template<typename T>
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<T>(), L, index)) {
// T is a class
return get(types<T>(), L, index);
}

View File

@ -85,16 +85,6 @@ class function;
class object;
namespace detail {
template<typename T>
inline type arithmetic(std::true_type) {
return type::number;
}
template<typename T>
inline type arithmetic(std::false_type) {
return usertype<T>(is_specialization_of<T, userdata>{});
}
template<typename T>
inline type usertype(std::true_type) {
return type::userdata;
@ -104,6 +94,16 @@ template<typename T>
inline type usertype(std::false_type) {
return type::none;
}
template<typename T>
inline type arithmetic(std::true_type) {
return type::number;
}
template<typename T>
inline type arithmetic(std::false_type) {
return usertype<T>(is_specialization_of<T, userdata>{});
}
} // detail
template<typename T>