From 42d9628d39c579ae9f337018a96dc74b7122a496 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 10 Dec 2024 16:25:52 +0100 Subject: [PATCH] meta: rework internals to work around a (maybe) compiler issue --- src/entt/meta/factory.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index 074c55922..24eed7234 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -122,13 +122,13 @@ class basic_meta_factory { basic_meta_factory(meta_ctx &area, meta_type_node node) : ctx{&area}, parent{node.info->hash()}, - bucket{parent} { - if(!node.details) { + bucket{parent}, + details{node.details.get()} { + if(details == nullptr) { node.details = std::make_shared(); + meta_context::from(*ctx).value[parent] = node; + details = node.details.get(); } - - details = node.details.get(); - meta_context::from(*ctx).value.try_emplace(parent, std::move(node)); } private: @@ -178,7 +178,7 @@ class meta_factory: private internal::basic_meta_factory { * @param area The context into which to construct meta types. */ meta_factory(meta_ctx &area) noexcept - : base_type{area, internal::resolve(internal::meta_context::from(area))} {} + : internal::basic_meta_factory{area, internal::resolve(internal::meta_context::from(area))} {} /** * @brief Assigns a custom unique identifier to a meta type.