Because bwuh.

This commit is contained in:
ThePhD 2016-03-05 02:42:19 -05:00
parent e417d5ce87
commit 5d722af1b0

View File

@ -254,6 +254,34 @@ struct getter<T, std::enable_if_t<std::is_base_of<reference, T>::value>> {
} }
}; };
template<>
struct getter<userdata> {
static userdata get(lua_State* L, int index = -1) {
return{ lua_touserdata(L, index) };
}
};
template<>
struct getter<light_userdata> {
static light_userdata get(lua_State* L, int index = -1) {
return{ lua_touserdata(L, index) };
}
};
template<>
struct getter<upvalue> {
static upvalue get(lua_State* L, int index = 1) {
return{ lua_touserdata(L, lua_upvalueindex(index)) };
}
};
template<>
struct getter<void*> {
static void* get(lua_State* L, int index = -1) {
return lua_touserdata(L, index);
}
};
template<typename T> template<typename T>
struct getter<T*> { struct getter<T*> {
static T* get_no_nil(lua_State* L, int index = -1) { static T* get_no_nil(lua_State* L, int index = -1) {
@ -354,34 +382,6 @@ struct getter<c_closure> {
} }
}; };
template<>
struct getter<userdata> {
static userdata get(lua_State* L, int index = -1) {
return{ lua_touserdata(L, index) };
}
};
template<>
struct getter<light_userdata> {
static light_userdata get(lua_State* L, int index = -1) {
return{ lua_touserdata(L, index) };
}
};
template<>
struct getter<upvalue> {
static upvalue get(lua_State* L, int index = 1) {
return{ lua_touserdata(L, lua_upvalueindex(index)) };
}
};
template<>
struct getter<void*> {
static void* get(lua_State* L, int index = -1) {
return lua_touserdata(L, index);
}
};
template<typename... Args> template<typename... Args>
struct getter<std::tuple<Args...>> { struct getter<std::tuple<Args...>> {
template <std::size_t... I> template <std::size_t... I>