|
@@ -262,13 +262,7 @@ class meta_factory {
|
|
|
return node && (node->identifier == identifier || duplicate(identifier, node->next));
|
|
return node && (node->identifier == identifier || duplicate(identifier, node->next));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-public:
|
|
|
|
|
- /**
|
|
|
|
|
- * @brief Extends a meta type by assigning it an identifier.
|
|
|
|
|
- * @param identifier Unique identifier.
|
|
|
|
|
- * @return An extended meta factory for the parent type.
|
|
|
|
|
- */
|
|
|
|
|
- auto type(const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT {
|
|
|
|
|
|
|
+ auto record(const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT {
|
|
|
auto * const node = internal::meta_info<Type>::resolve();
|
|
auto * const node = internal::meta_info<Type>::resolve();
|
|
|
|
|
|
|
|
ENTT_ASSERT(!duplicate(identifier, *internal::meta_info<>::ctx));
|
|
ENTT_ASSERT(!duplicate(identifier, *internal::meta_info<>::ctx));
|
|
@@ -280,6 +274,32 @@ public:
|
|
|
return extended_meta_factory<Type>{&node->prop};
|
|
return extended_meta_factory<Type>{&node->prop};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+public:
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Extends a meta type by assigning it an identifier.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This function is intended only for unnamed types.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param identifier Unique identifier.
|
|
|
|
|
+ * @return An extended meta factory for the parent type.
|
|
|
|
|
+ */
|
|
|
|
|
+ auto type(const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT {
|
|
|
|
|
+ static_assert(!is_named_type_v<Type>);
|
|
|
|
|
+ return record(identifier);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Extends a meta type by assigning it an identifier.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This function is intended only for named types
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return An extended meta factory for the parent type.
|
|
|
|
|
+ */
|
|
|
|
|
+ auto type() ENTT_NOEXCEPT {
|
|
|
|
|
+ static_assert(is_named_type_v<Type>);
|
|
|
|
|
+ return record(named_type_traits_t<Type>::value);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @brief Assigns a meta base to a meta type.
|
|
* @brief Assigns a meta base to a meta type.
|
|
|
*
|
|
*
|