meta: decouple meta_template_node and meta_type_node

This commit is contained in:
Michele Caini
2022-08-23 19:05:55 +02:00
parent 9549bb4f4d
commit 461fe715b7
2 changed files with 3 additions and 3 deletions

View File

@@ -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;
}
/**

View File

@@ -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<meta_template_traits<Type>>) {
return meta_template_node{
meta_template_traits<Type>::args_type::size,
meta_node<typename meta_template_traits<Type>::class_type>::resolve(),
&meta_node<typename meta_template_traits<Type>::class_type>::resolve,
+[](const std::size_t index) noexcept -> meta_type_node * { return meta_arg_node(typename meta_template_traits<Type>::args_type{}, index); }};
} else {
return meta_template_node{};