Browse Source

meta: decouple meta_prop_node and meta_type_node

Michele Caini 3 years ago
parent
commit
f0b10965fb
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

@@ -82,7 +82,7 @@ public:
     template<typename... Value>
     meta_factory prop(id_type key, Value &&...value) {
         (*container)[key] = internal::meta_prop_node{
-            internal::meta_node<std::decay_t<Value>>::resolve()...,
+            &internal::meta_node<std::decay_t<Value>>::resolve...,
             std::forward<Value>(value)...};
 
         return *this;

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

@@ -669,7 +669,7 @@ struct meta_prop {
      * @return A wrapper containing the value stored with the property.
      */
     [[nodiscard]] meta_any value() const {
-        return (node && node->type) ? node->type->from_void(nullptr, node->value.data()) : meta_any{};
+        return (node && node->type) ? node->type()->from_void(nullptr, node->value.data()) : meta_any{};
     }
 
     /**

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

@@ -46,7 +46,7 @@ enum class meta_traits : std::uint32_t {
 struct meta_type_node;
 
 struct meta_prop_node {
-    meta_type_node *type{nullptr};
+    meta_type_node *(*type)() noexcept {nullptr};
     basic_any<0u> value{};
 };