Browse Source

meta: bring meta custom back in place

skypjack 5 months ago
parent
commit
b9bfeb9b3d
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

@@ -118,7 +118,7 @@ protected:
 
     void custom(meta_custom_node node) {
         if(bucket == parent) {
-            fetch_node().details->custom = std::move(node);
+            fetch_node().custom = std::move(node);
         } else if(invoke == nullptr) {
             find_member_or_assert()->custom = std::move(node);
         } else {

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

@@ -1490,7 +1490,7 @@ public:
 
     /*! @copydoc meta_data::custom */
     [[nodiscard]] meta_custom custom() const noexcept {
-        return fetch_node().details ? meta_custom{fetch_node().details->custom} : meta_custom{};
+        return meta_custom{fetch_node().custom};
     }
 
     /**

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

@@ -129,7 +129,6 @@ struct meta_type_descriptor {
     std::vector<meta_conv_node> conv;
     std::vector<meta_data_node> data;
     std::vector<meta_func_node> func;
-    meta_custom_node custom{};
 };
 
 struct meta_type_node {
@@ -145,6 +144,7 @@ struct meta_type_node {
     double (*conversion_helper)(void *, const void *){};
     meta_any (*from_void)(const meta_ctx &, void *, const void *){};
     meta_template_node templ{};
+    meta_custom_node custom{};
     std::unique_ptr<meta_type_descriptor> details;
 };