freeze changes

This commit is contained in:
ThePhD 2018-06-16 07:56:07 -04:00
parent bd392ee3da
commit 860827cb0a
4 changed files with 3 additions and 12 deletions

View File

@ -48,14 +48,6 @@ namespace sol {
typedef types<> type;
};
template <typename T>
struct has_derived {
static bool value;
};
template <typename T>
bool has_derived<T>::value = false;
inline decltype(auto) base_class_check_key() {
static const auto& key = "class_check";
return key;

View File

@ -473,7 +473,7 @@ namespace stack {
if (stack_detail::check_metatable<as_container_t<U>>(L, metatableindex))
return true;
bool success = false;
if (detail::has_derived<T>::value) {
if (detail::derive<T>::value) {
auto pn = stack::pop_n(L, 1);
lua_pushstring(L, &detail::base_class_check_key()[0]);
lua_rawget(L, metatableindex);

View File

@ -759,7 +759,7 @@ namespace stack {
}
static T* get_no_lua_nil_from(lua_State* L, void* udata, int index, record&) {
if (detail::has_derived<T>::value && luaL_getmetafield(L, index, &detail::base_class_cast_key()[0]) != 0) {
if (detail::derive<T>::value && luaL_getmetafield(L, index, &detail::base_class_cast_key()[0]) != 0) {
void* basecastdata = lua_touserdata(L, -1);
detail::inheritance_cast_function ic = reinterpret_cast<detail::inheritance_cast_function>(basecastdata);
// use the casting function to properly adjust the pointer for the desired T

View File

@ -463,8 +463,7 @@ namespace sol {
return;
}
mustindex = true;
(void)detail::swallow{0, ((detail::has_derived<Bases>::value = true), 0)...};
static_assert(sizeof(void*) <= sizeof(detail::inheritance_check_function), "The size of this data pointer is too small to fit the inheritance checking function: file a bug report.");
static_assert(sizeof(void*) <= sizeof(detail::inheritance_cast_function), "The size of this data pointer is too small to fit the inheritance checking function: file a bug report.");
baseclasscheck = (void*)&detail::inheritance<T, Bases...>::type_check;