meta: drop the meta<Type> function

This commit is contained in:
Michele Caini
2025-03-20 19:02:01 +01:00
parent d45c2aca8a
commit dbcc0baa7b
2 changed files with 0 additions and 52 deletions

View File

@@ -460,39 +460,6 @@ public:
}
};
/**
* @brief Utility function to use for reflection.
*
* This is the point from which everything starts.<br/>
* By invoking this function with a type that is not yet reflected, a meta type
* is created to which it will be possible to attach meta objects through a
* dedicated factory.
*
* @tparam Type Type to reflect.
* @param ctx The context into which to construct meta types.
* @return A meta factory for the given type.
*/
template<typename Type>
[[nodiscard]] [[deprecated("use meta_factory directly instead")]] auto meta(meta_ctx &ctx) noexcept {
return meta_factory<Type>{ctx};
}
/**
* @brief Utility function to use for reflection.
*
* This is the point from which everything starts.<br/>
* By invoking this function with a type that is not yet reflected, a meta type
* is created to which it will be possible to attach meta objects through a
* dedicated factory.
*
* @tparam Type Type to reflect.
* @return A meta factory for the given type.
*/
template<typename Type>
[[nodiscard]] [[deprecated("use meta_factory directly instead")]] auto meta() noexcept {
return meta<Type>(locator<meta_ctx>::value_or());
}
/**
* @brief Resets a type and all its parts.
*

View File

@@ -414,25 +414,6 @@ TEST_F(MetaFactory, Custom) {
ASSERT_EQ(static_cast<int>(type.func("func"_hs).next().custom()), 3);
}
TEST_F(MetaFactory, Meta) {
entt::meta_ctx ctx{};
ASSERT_EQ(entt::resolve(entt::type_id<int>()), entt::meta_type{});
ASSERT_EQ(entt::resolve(ctx, entt::type_id<int>()), entt::meta_type{});
auto factory = entt::meta<int>();
ASSERT_NE(entt::resolve(entt::type_id<int>()), entt::meta_type{});
ASSERT_EQ(entt::resolve(ctx, entt::type_id<int>()), entt::meta_type{});
ASSERT_TRUE(entt::resolve(entt::type_id<int>()).is_integral());
factory = entt::meta<int>(ctx);
ASSERT_NE(entt::resolve(entt::type_id<int>()), entt::meta_type{});
ASSERT_NE(entt::resolve(ctx, entt::type_id<int>()), entt::meta_type{});
ASSERT_TRUE(entt::resolve(ctx, entt::type_id<int>()).is_integral());
}
TEST_F(MetaFactory, MetaReset) {
using namespace entt::literals;