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:
ThePhD 2014-05-29 02:38:02 -04:00
parent a8e9c01d0d
commit 065215864b
2 changed files with 5 additions and 5 deletions

View File

@ -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>
@ -351,4 +351,4 @@ struct get_return {
} // stack } // stack
} // sol } // sol
#endif // SOL_STACK_HPP #endif // SOL_STACK_HPP

View File

@ -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;