Browse Source

meta: decouple meta_base_node and meta_type_node

Michele Caini 3 years ago
parent
commit
7c6606f27e
3 changed files with 3 additions and 3 deletions
  1. 1 1
      src/entt/meta/factory.hpp
  2. 1 1
      src/entt/meta/meta.hpp
  3. 1 1
      src/entt/meta/node.hpp

+ 1 - 1
src/entt/meta/factory.hpp

@@ -144,7 +144,7 @@ public:
         static_assert(!std::is_same_v<Type, Base> && std::is_base_of_v<Base, Type>, "Invalid base type");
 
         owner->base[type_id<Base>().hash()] = internal::meta_base_node{
-            internal::meta_node<Base>::resolve(),
+            &internal::meta_node<Base>::resolve,
             [](meta_any other) noexcept -> meta_any {
                 if(auto *ptr = other.data(); ptr) {
                     return forward_as_meta(*static_cast<Base *>(static_cast<Type *>(ptr)));

+ 1 - 1
src/entt/meta/meta.hpp

@@ -972,7 +972,7 @@ public:
      * @param curr The base node with which to construct the instance.
      */
     meta_type(const base_node_type *curr) noexcept
-        : node{curr ? curr->type : nullptr} {}
+        : node{curr ? curr->type() : nullptr} {}
 
     /**
      * @brief Returns the type info object of the underlying type.

+ 1 - 1
src/entt/meta/node.hpp

@@ -51,7 +51,7 @@ struct meta_prop_node {
 };
 
 struct meta_base_node {
-    meta_type_node *type;
+    meta_type_node *(*type)() noexcept;
     meta_any (*cast)(meta_any) noexcept;
 };