From 860827cb0af97977d28bba8f02eb9d129266d838 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 16 Jun 2018 07:56:07 -0400 Subject: [PATCH] freeze changes --- sol/inheritance.hpp | 8 -------- sol/stack_check_unqualified.hpp | 2 +- sol/stack_get_unqualified.hpp | 2 +- sol/usertype_metatable.hpp | 3 +-- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/sol/inheritance.hpp b/sol/inheritance.hpp index 886cef78..abd9dcff 100644 --- a/sol/inheritance.hpp +++ b/sol/inheritance.hpp @@ -48,14 +48,6 @@ namespace sol { typedef types<> type; }; - template - struct has_derived { - static bool value; - }; - - template - bool has_derived::value = false; - inline decltype(auto) base_class_check_key() { static const auto& key = "class_check"; return key; diff --git a/sol/stack_check_unqualified.hpp b/sol/stack_check_unqualified.hpp index 3ad01856..33b5b634 100644 --- a/sol/stack_check_unqualified.hpp +++ b/sol/stack_check_unqualified.hpp @@ -473,7 +473,7 @@ namespace stack { if (stack_detail::check_metatable>(L, metatableindex)) return true; bool success = false; - if (detail::has_derived::value) { + if (detail::derive::value) { auto pn = stack::pop_n(L, 1); lua_pushstring(L, &detail::base_class_check_key()[0]); lua_rawget(L, metatableindex); diff --git a/sol/stack_get_unqualified.hpp b/sol/stack_get_unqualified.hpp index aa279d60..a4eecd67 100644 --- a/sol/stack_get_unqualified.hpp +++ b/sol/stack_get_unqualified.hpp @@ -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::value && luaL_getmetafield(L, index, &detail::base_class_cast_key()[0]) != 0) { + if (detail::derive::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(basecastdata); // use the casting function to properly adjust the pointer for the desired T diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index a5ee4e0a..61ad8254 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -463,8 +463,7 @@ namespace sol { return; } mustindex = true; - (void)detail::swallow{0, ((detail::has_derived::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::type_check;