mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
freeze changes
This commit is contained in:
parent
bd392ee3da
commit
860827cb0a
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user