Remove reference when creating new reference types on the stack

This commit is contained in:
Rapptz 2014-05-29 01:26:46 -04:00
parent 2f84be5c5e
commit 54f030873f

View File

@ -68,9 +68,9 @@ inline T& get(types<userdata<T>>, lua_State* L, int index = -1) {
return *obj;
}
template <typename T>
inline T get(types<T>, lua_State* L, int index = -1) {
return T(L, index);
template <typename T, typename U = typename std::remove_reference<T>::type>
inline U get(types<T>, lua_State* L, int index = -1) {
return U(L, index);
}
template<typename T>