mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
libstdc++ is literally the dumbest thing in the world and does not properly remove const from types with references
Must remove_reference<T> before remove_cv<T>
This commit is contained in:
parent
a8e9c01d0d
commit
065215864b
|
@ -136,10 +136,10 @@ inline void push_arithmetic(std::false_type, lua_State* L, T x) {
|
||||||
}
|
}
|
||||||
} // detail
|
} // detail
|
||||||
|
|
||||||
template<typename T>
|
template<typename T, typename U = Unqualified<T>>
|
||||||
inline auto get(lua_State* L, int index = -1)
|
inline auto get(lua_State* L, int index = -1)
|
||||||
-> decltype(detail::get_helper<T>(std::is_arithmetic<T>{}, L, index)) {
|
-> decltype(detail::get_helper<U>(std::is_arithmetic<U>{}, L, index)) {
|
||||||
return detail::get_helper<T>(std::is_arithmetic<T>{}, L, index);
|
return detail::get_helper<U>(std::is_arithmetic<U>{}, L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -33,7 +33,7 @@ template<typename T, typename R = void>
|
||||||
using DisableIf = typename std::enable_if<!T::value, R>::type;
|
using DisableIf = typename std::enable_if<!T::value, R>::type;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using Unqualified = typename std::remove_reference<typename std::remove_cv<T>::type>::type;
|
using Unqualified = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using Decay = typename std::decay<T>::type;
|
using Decay = typename std::decay<T>::type;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user