diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 405d4fb82..012094f6b 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -1115,7 +1115,7 @@ public: * @return The tag for the class template of the underlying type. */ [[nodiscard]] inline meta_type template_type() const noexcept { - return node->templ.type; + return node->templ.type ? node->templ.type() : nullptr; } /** diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index f27db723a..322487cab 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -100,7 +100,7 @@ struct meta_template_node { using size_type = std::size_t; size_type arity{0u}; - meta_type_node *type{nullptr}; + meta_type_node *(*type)() noexcept {nullptr}; meta_type_node *(*arg)(const size_type) noexcept {nullptr}; }; @@ -172,7 +172,7 @@ class ENTT_API meta_node { if constexpr(is_complete_v>) { return meta_template_node{ meta_template_traits::args_type::size, - meta_node::class_type>::resolve(), + &meta_node::class_type>::resolve, +[](const std::size_t index) noexcept -> meta_type_node * { return meta_arg_node(typename meta_template_traits::args_type{}, index); }}; } else { return meta_template_node{};