mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Fixing some basic bugs MSVC didn't catch
This commit is contained in:
parent
f842de2d06
commit
f17d30592c
|
@ -107,7 +107,8 @@ inline bool get_helper<bool>(std::true_type, lua_State* L, int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
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
|
// T is a class
|
||||||
return get(types<T>(), L, index);
|
return get(types<T>(), L, index);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,16 +85,6 @@ class function;
|
||||||
class object;
|
class object;
|
||||||
|
|
||||||
namespace detail {
|
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>
|
template<typename T>
|
||||||
inline type usertype(std::true_type) {
|
inline type usertype(std::true_type) {
|
||||||
return type::userdata;
|
return type::userdata;
|
||||||
|
@ -104,6 +94,16 @@ template<typename T>
|
||||||
inline type usertype(std::false_type) {
|
inline type usertype(std::false_type) {
|
||||||
return type::none;
|
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
|
} // detail
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user