diff --git a/TODO b/TODO index eca88e606..5242c82cd 100644 --- a/TODO +++ b/TODO @@ -34,3 +34,4 @@ TODO: * resource: shared_from_this? * change meta_any::base name, it's confusing due to meta_base_node and base types in meta * parent link in data and func meta objects +* remove operator-> from meta_handle, only allow try_cast diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index c85346650..0bb4c539f 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -660,12 +660,8 @@ class meta_handle { public: /*! Default constructor. */ - [[deprecated("not necessary, use direct contructors instead")]] meta_handle() = default; - /*! @brief Empty constructor. */ - meta_handle(std::nullptr_t) {} - /** * @brief Creates a handle that points to an unmanaged object. * @tparam Type Type of object to use to initialize the handle. diff --git a/test/entt/meta/meta_context.cpp b/test/entt/meta/meta_context.cpp index b906282db..559e91964 100644 --- a/test/entt/meta/meta_context.cpp +++ b/test/entt/meta/meta_context.cpp @@ -236,11 +236,11 @@ TEST_F(MetaContext, MetaData) { ASSERT_FALSE(global.data("value"_hs).is_const()); ASSERT_TRUE(local.data("value"_hs).is_const()); - ASSERT_EQ(global.data("value"_hs).type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.data("value"_hs).type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.data("value"_hs).type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.data("value"_hs).type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); - ASSERT_EQ(global.data("rw"_hs).arg(0u).data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.data("rw"_hs).arg(0u).data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.data("rw"_hs).arg(0u).data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.data("rw"_hs).arg(0u).data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); clazz instance{'c', 8}; const argument value{2}; @@ -271,11 +271,11 @@ TEST_F(MetaContext, MetaFunc) { ASSERT_FALSE(global.func("func"_hs).is_const()); ASSERT_TRUE(local.func("func"_hs).is_const()); - ASSERT_EQ(global.func("func"_hs).arg(0u).data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.func("func"_hs).arg(0u).data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.func("func"_hs).arg(0u).data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.func("func"_hs).arg(0u).data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); - ASSERT_EQ(global.func("func"_hs).ret().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.func("func"_hs).ret().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.func("func"_hs).ret().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.func("func"_hs).ret().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); clazz instance{'c', 8}; const argument value{2}; @@ -364,8 +364,8 @@ TEST_F(MetaContext, MetaTemplate) { ASSERT_EQ(local.template_arg(0u), entt::resolve(ctx())); ASSERT_EQ(local.template_arg(1u), entt::resolve(ctx())); - ASSERT_EQ(global.template_arg(0u).data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.template_arg(0u).data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.template_arg(0u).data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.template_arg(0u).data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } TEST_F(MetaContext, MetaPointer) { @@ -382,8 +382,8 @@ TEST_F(MetaContext, MetaPointer) { ASSERT_TRUE(global.type().is_pointer_like()); ASSERT_TRUE(local.type().is_pointer_like()); - ASSERT_EQ((*global).type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ((*local).type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ((*global).type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ((*local).type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } TEST_F(MetaContext, MetaAssociativeContainer) { @@ -400,17 +400,17 @@ TEST_F(MetaContext, MetaAssociativeContainer) { ASSERT_EQ(global.size(), 1u); ASSERT_EQ(local.size(), 1u); - ASSERT_EQ(global.key_type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.key_type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.key_type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.key_type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); - ASSERT_EQ(global.mapped_type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.mapped_type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.mapped_type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.mapped_type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); - ASSERT_EQ((*global.begin()).first.type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ((*local.begin()).first.type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ((*global.begin()).first.type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ((*local.begin()).first.type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); - ASSERT_EQ((*global.begin()).second.type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ((*local.begin()).second.type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ((*global.begin()).second.type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ((*local.begin()).second.type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } TEST_F(MetaContext, MetaSequenceContainer) { @@ -427,11 +427,11 @@ TEST_F(MetaContext, MetaSequenceContainer) { ASSERT_EQ(global.size(), 1u); ASSERT_EQ(local.size(), 1u); - ASSERT_EQ(global.value_type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.value_type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.value_type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.value_type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); - ASSERT_EQ((*global.begin()).type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ((*local.begin()).type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ((*global.begin()).type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ((*local.begin()).type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } TEST_F(MetaContext, MetaAny) { @@ -451,10 +451,10 @@ TEST_F(MetaContext, MetaAny) { ASSERT_TRUE(two_step_local); - ASSERT_EQ(global.type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(ctx_value.type().data("marker"_hs).get(nullptr).cast(), local_marker); - ASSERT_EQ(in_place.type().data("marker"_hs).get(nullptr).cast(), local_marker); - ASSERT_EQ(two_step_local.type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(ctx_value.type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); + ASSERT_EQ(in_place.type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); + ASSERT_EQ(two_step_local.type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } TEST_F(MetaContext, MetaHandle) { @@ -464,19 +464,12 @@ TEST_F(MetaContext, MetaHandle) { entt::meta_handle global{value}; entt::meta_handle ctx_value{ctx(), value}; - entt::meta_handle two_step_local{entt::meta_ctx_arg, ctx()}; ASSERT_TRUE(global); ASSERT_TRUE(ctx_value); - ASSERT_FALSE(two_step_local); - two_step_local->emplace(value); - - ASSERT_TRUE(two_step_local); - - ASSERT_EQ(global->type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(ctx_value->type().data("marker"_hs).get(nullptr).cast(), local_marker); - ASSERT_EQ(two_step_local->type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global->type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(ctx_value->type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } TEST_F(MetaContext, ForwardAsMeta) { @@ -488,6 +481,6 @@ TEST_F(MetaContext, ForwardAsMeta) { ASSERT_TRUE(global); ASSERT_TRUE(local); - ASSERT_EQ(global.type().data("marker"_hs).get(nullptr).cast(), global_marker); - ASSERT_EQ(local.type().data("marker"_hs).get(nullptr).cast(), local_marker); + ASSERT_EQ(global.type().data("marker"_hs).get(entt::meta_any{}).cast(), global_marker); + ASSERT_EQ(local.type().data("marker"_hs).get(entt::meta_any{}).cast(), local_marker); } diff --git a/test/entt/meta/meta_data.cpp b/test/entt/meta/meta_data.cpp index 55b41f192..931f94b7b 100644 --- a/test/entt/meta/meta_data.cpp +++ b/test/entt/meta/meta_data.cpp @@ -229,9 +229,9 @@ TEST_F(MetaData, Static) { ASSERT_EQ(data.arg(0u), entt::resolve()); ASSERT_FALSE(data.is_const()); ASSERT_TRUE(data.is_static()); - ASSERT_EQ(data.get(nullptr).cast(), 2); - ASSERT_TRUE(data.set(nullptr, 1)); - ASSERT_EQ(data.get(nullptr).cast(), 1); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 2); + ASSERT_TRUE(data.set(entt::meta_any{}, 1)); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 1); } TEST_F(MetaData, ConstStatic) { @@ -245,9 +245,9 @@ TEST_F(MetaData, ConstStatic) { ASSERT_EQ(data.arg(0u), entt::resolve()); ASSERT_TRUE(data.is_const()); ASSERT_TRUE(data.is_static()); - ASSERT_EQ(data.get(nullptr).cast(), 3); - ASSERT_FALSE(data.set(nullptr, 1)); - ASSERT_EQ(data.get(nullptr).cast(), 3); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 3); + ASSERT_FALSE(data.set(entt::meta_any{}, 1)); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 3); } TEST_F(MetaData, Literal) { @@ -261,9 +261,9 @@ TEST_F(MetaData, Literal) { ASSERT_EQ(data.arg(0u), entt::resolve()); ASSERT_TRUE(data.is_const()); ASSERT_TRUE(data.is_static()); - ASSERT_EQ(data.get(nullptr).cast(), 'c'); - ASSERT_FALSE(data.set(nullptr, 'a')); - ASSERT_EQ(data.get(nullptr).cast(), 'c'); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 'c'); + ASSERT_FALSE(data.set(entt::meta_any{}, 'a')); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 'c'); } TEST_F(MetaData, GetMetaAnyArg) { @@ -299,7 +299,7 @@ TEST_F(MetaData, SetMetaAnyArg) { TEST_F(MetaData, SetInvalidArg) { using namespace entt::literals; - ASSERT_FALSE(entt::resolve().data("i"_hs).set(nullptr, 'c')); + ASSERT_FALSE(entt::resolve().data("i"_hs).set(entt::meta_any{}, 'c')); } TEST_F(MetaData, SetCast) { @@ -505,7 +505,7 @@ TEST_F(MetaData, ArrayStatic) { ASSERT_FALSE(data.is_const()); ASSERT_TRUE(data.is_static()); ASSERT_TRUE(data.type().is_array()); - ASSERT_FALSE(data.get(nullptr)); + ASSERT_FALSE(data.get(entt::meta_any{})); } TEST_F(MetaData, Array) { diff --git a/test/entt/meta/meta_factory.cpp b/test/entt/meta/meta_factory.cpp index 698944bd3..e42b34fae 100644 --- a/test/entt/meta/meta_factory.cpp +++ b/test/entt/meta/meta_factory.cpp @@ -195,8 +195,8 @@ TEST_F(MetaFactory, DataPointer) { type = entt::resolve(); ASSERT_TRUE(type.data("value"_hs)); - ASSERT_EQ(type.get("value"_hs, nullptr), value); - ASSERT_TRUE(type.set("value"_hs, nullptr, value)); + ASSERT_EQ(type.get("value"_hs, entt::meta_any{}), value); + ASSERT_TRUE(type.set("value"_hs, entt::meta_any{}, value)); } TEST_F(MetaFactory, DataValue) { @@ -212,8 +212,8 @@ TEST_F(MetaFactory, DataValue) { type = entt::resolve(); ASSERT_TRUE(type.data("value"_hs)); - ASSERT_EQ(type.get("value"_hs, nullptr), value); - ASSERT_FALSE(type.set("value"_hs, nullptr, value)); + ASSERT_EQ(type.get("value"_hs, entt::meta_any{}), value); + ASSERT_FALSE(type.set("value"_hs, entt::meta_any{}, value)); } TEST_F(MetaFactory, DataGetterOnly) { @@ -290,7 +290,7 @@ TEST_F(MetaFactory, Func) { ASSERT_TRUE(type.func("func"_hs)); ASSERT_TRUE(type.invoke("func"_hs, instance)); ASSERT_EQ(type.invoke("func"_hs, instance).cast(), instance.get_int()); - ASSERT_FALSE(type.invoke("func"_hs, nullptr)); + ASSERT_FALSE(type.invoke("func"_hs, entt::meta_any{})); } TEST_F(MetaFactory, FuncOverload) { diff --git a/test/entt/meta/meta_func.cpp b/test/entt/meta/meta_func.cpp index c9f950429..bef649190 100644 --- a/test/entt/meta/meta_func.cpp +++ b/test/entt/meta/meta_func.cpp @@ -301,8 +301,8 @@ TEST_F(MetaFunc, Static) { ASSERT_EQ(func.arg(1u), entt::resolve()); ASSERT_FALSE(func.arg(2u)); - auto any = func.invoke(nullptr, 3, entt::forward_as_meta(instance)); - auto empty = func.invoke(nullptr, derived{}, entt::forward_as_meta(instance)); + auto any = func.invoke(entt::meta_any{}, 3, entt::forward_as_meta(instance)); + auto empty = func.invoke(entt::meta_any{}, derived{}, entt::forward_as_meta(instance)); ASSERT_FALSE(empty); ASSERT_TRUE(any); @@ -325,7 +325,7 @@ TEST_F(MetaFunc, StaticRetVoid) { ASSERT_EQ(func.arg(1u), entt::resolve()); ASSERT_FALSE(func.arg(2u)); - auto any = func.invoke(nullptr, 3, entt::forward_as_meta(instance)); + auto any = func.invoke(entt::meta_any{}, 3, entt::forward_as_meta(instance)); ASSERT_TRUE(any); ASSERT_EQ(any.type(), entt::resolve()); @@ -347,7 +347,7 @@ TEST_F(MetaFunc, StaticAsMember) { ASSERT_EQ(func.arg(0u), entt::resolve()); ASSERT_FALSE(func.arg(1u)); - ASSERT_FALSE(func.invoke(nullptr, 3)); + ASSERT_FALSE(func.invoke(entt::meta_any{}, 3)); ASSERT_FALSE(func.invoke(std::as_const(instance), 3)); ASSERT_TRUE(any); @@ -369,7 +369,7 @@ TEST_F(MetaFunc, StaticAsConstMember) { ASSERT_EQ(func.ret(), entt::resolve()); ASSERT_FALSE(func.arg(0u)); - ASSERT_FALSE(func.invoke(nullptr)); + ASSERT_FALSE(func.invoke(entt::meta_any{})); ASSERT_TRUE(func.invoke(instance)); ASSERT_TRUE(any); @@ -391,7 +391,7 @@ TEST_F(MetaFunc, NonClassTypeMember) { ASSERT_EQ(func.ret(), entt::resolve()); ASSERT_FALSE(func.arg(0u)); - ASSERT_FALSE(func.invoke(nullptr)); + ASSERT_FALSE(func.invoke(entt::meta_any{})); ASSERT_TRUE(func.invoke(instance)); ASSERT_TRUE(any); @@ -451,8 +451,8 @@ TEST_F(MetaFunc, ArgsByRef) { entt::meta_any any{3}; int value = 4; - ASSERT_EQ(func.invoke(nullptr, entt::forward_as_meta(value), entt::forward_as_meta(instance)).cast(), 8); - ASSERT_EQ(func.invoke(nullptr, any.as_ref(), entt::forward_as_meta(instance)).cast(), 6); + ASSERT_EQ(func.invoke(entt::meta_any{}, entt::forward_as_meta(value), entt::forward_as_meta(instance)).cast(), 8); + ASSERT_EQ(func.invoke(entt::meta_any{}, any.as_ref(), entt::forward_as_meta(instance)).cast(), 6); ASSERT_EQ(any.cast(), 6); ASSERT_EQ(value, 8); } @@ -589,7 +589,7 @@ TEST_F(MetaFunc, ExternalMemberFunction) { ASSERT_FALSE(registry.all_of(entity)); - func.invoke(nullptr, entt::forward_as_meta(registry), entity); + func.invoke(entt::meta_any{}, entt::forward_as_meta(registry), entity); ASSERT_TRUE(registry.all_of(entity)); } diff --git a/test/entt/meta/meta_handle.cpp b/test/entt/meta/meta_handle.cpp index cfc8cc53b..51c2dbcf5 100644 --- a/test/entt/meta/meta_handle.cpp +++ b/test/entt/meta/meta_handle.cpp @@ -41,22 +41,12 @@ TEST_F(MetaHandle, Handle) { ASSERT_FALSE(handle); ASSERT_FALSE(chandle); - ASSERT_EQ(handle, chandle); - ASSERT_EQ(handle, entt::meta_handle{}); - ASSERT_FALSE(handle != handle); - ASSERT_TRUE(handle == handle); - handle = entt::meta_handle{instance}; chandle = entt::meta_handle{std::as_const(instance)}; ASSERT_TRUE(handle); ASSERT_TRUE(chandle); - ASSERT_EQ(handle, chandle); - ASSERT_NE(handle, entt::meta_handle{}); - ASSERT_FALSE(handle != handle); - ASSERT_TRUE(handle == handle); - ASSERT_TRUE(handle->invoke("incr"_hs)); ASSERT_FALSE(chandle->invoke("incr"_hs)); ASSERT_FALSE(std::as_const(handle)->invoke("incr"_hs)); diff --git a/test/entt/meta/meta_range.cpp b/test/entt/meta/meta_range.cpp index 38cfaebd2..a8e519136 100644 --- a/test/entt/meta/meta_range.cpp +++ b/test/entt/meta/meta_range.cpp @@ -93,6 +93,6 @@ TEST_F(MetaRange, DirectValue) { for(auto &&[id, data]: range) { ASSERT_EQ(id, "answer"_hs); - ASSERT_EQ(data.get(nullptr).cast(), 2); + ASSERT_EQ(data.get(entt::meta_any{}).cast(), 2); } } diff --git a/test/entt/meta/meta_type.cpp b/test/entt/meta/meta_type.cpp index 1681d63e4..76e63f40b 100644 --- a/test/entt/meta/meta_type.cpp +++ b/test/entt/meta/meta_type.cpp @@ -251,12 +251,12 @@ TEST_F(MetaType, SafeWhenEmpty) { ASSERT_FALSE(type.from_void(static_cast(&type), true)); ASSERT_FALSE(type.from_void(static_cast(nullptr))); ASSERT_FALSE(type.from_void(static_cast(&type))); - ASSERT_FALSE(type.invoke("func"_hs, nullptr, args, 0u)); - ASSERT_FALSE(type.invoke("func"_hs, nullptr, args, 1u)); - ASSERT_FALSE(type.invoke("func"_hs, nullptr)); - ASSERT_FALSE(type.invoke("func"_hs, nullptr, 'c')); - ASSERT_FALSE(type.set("data"_hs, nullptr, 0)); - ASSERT_FALSE(type.get("data"_hs, nullptr)); + ASSERT_FALSE(type.invoke("func"_hs, entt::meta_any{}, args, 0u)); + ASSERT_FALSE(type.invoke("func"_hs, entt::meta_any{}, args, 1u)); + ASSERT_FALSE(type.invoke("func"_hs, entt::meta_any{})); + ASSERT_FALSE(type.invoke("func"_hs, entt::meta_any{}, 'c')); + ASSERT_FALSE(type.set("data"_hs, entt::meta_any{}, 0)); + ASSERT_FALSE(type.get("data"_hs, entt::meta_any{})); ASSERT_EQ(type.traits(), test::meta_traits::none); ASSERT_EQ(static_cast(type.custom()), nullptr); } @@ -466,7 +466,7 @@ TEST_F(MetaType, Func) { ASSERT_TRUE(type.func("member"_hs)); ASSERT_TRUE(type.func("func"_hs)); ASSERT_TRUE(type.func("member"_hs).invoke(instance)); - ASSERT_TRUE(type.func("func"_hs).invoke(nullptr)); + ASSERT_TRUE(type.func("func"_hs).invoke(entt::meta_any{})); type = entt::resolve(); @@ -483,8 +483,8 @@ TEST_F(MetaType, Invoke) { ASSERT_TRUE(type.invoke("member"_hs, instance)); ASSERT_FALSE(type.invoke("rebmem"_hs, instance)); - ASSERT_TRUE(type.invoke("func"_hs, nullptr)); - ASSERT_FALSE(type.invoke("cnuf"_hs, nullptr)); + ASSERT_TRUE(type.invoke("func"_hs, entt::meta_any{})); + ASSERT_FALSE(type.invoke("cnuf"_hs, entt::meta_any{})); } TEST_F(MetaType, InvokeFromBase) { @@ -494,7 +494,7 @@ TEST_F(MetaType, InvokeFromBase) { concrete instance{}; ASSERT_TRUE(type.invoke("base_only"_hs, instance, 3)); - ASSERT_FALSE(type.invoke("ylno_esab"_hs, nullptr, 'c')); + ASSERT_FALSE(type.invoke("ylno_esab"_hs, entt::meta_any{}, 'c')); } TEST_F(MetaType, OverloadedFunc) { @@ -766,14 +766,14 @@ TEST_F(MetaType, EnumAndNamedConstants) { ASSERT_EQ(type.data("value"_hs).type(), type); ASSERT_EQ(type.data("other"_hs).type(), type); - ASSERT_EQ(type.data("value"_hs).get(nullptr).cast(), property_type::value); - ASSERT_EQ(type.data("other"_hs).get(nullptr).cast(), property_type::other); + ASSERT_EQ(type.data("value"_hs).get(entt::meta_any{}).cast(), property_type::value); + ASSERT_EQ(type.data("other"_hs).get(entt::meta_any{}).cast(), property_type::other); - ASSERT_FALSE(type.data("value"_hs).set(nullptr, property_type::other)); - ASSERT_FALSE(type.data("other"_hs).set(nullptr, property_type::value)); + ASSERT_FALSE(type.data("value"_hs).set(entt::meta_any{}, property_type::other)); + ASSERT_FALSE(type.data("other"_hs).set(entt::meta_any{}, property_type::value)); - ASSERT_EQ(type.data("value"_hs).get(nullptr).cast(), property_type::value); - ASSERT_EQ(type.data("other"_hs).get(nullptr).cast(), property_type::other); + ASSERT_EQ(type.data("value"_hs).get(entt::meta_any{}).cast(), property_type::value); + ASSERT_EQ(type.data("other"_hs).get(entt::meta_any{}).cast(), property_type::other); } TEST_F(MetaType, ArithmeticTypeAndNamedConstants) { @@ -787,11 +787,11 @@ TEST_F(MetaType, ArithmeticTypeAndNamedConstants) { ASSERT_EQ(type.data("min"_hs).type(), type); ASSERT_EQ(type.data("max"_hs).type(), type); - ASSERT_FALSE(type.data("min"_hs).set(nullptr, 128u)); - ASSERT_FALSE(type.data("max"_hs).set(nullptr, 0u)); + ASSERT_FALSE(type.data("min"_hs).set(entt::meta_any{}, 128u)); + ASSERT_FALSE(type.data("max"_hs).set(entt::meta_any{}, 0u)); - ASSERT_EQ(type.data("min"_hs).get(nullptr).cast(), 0u); - ASSERT_EQ(type.data("max"_hs).get(nullptr).cast(), 128u); + ASSERT_EQ(type.data("min"_hs).get(entt::meta_any{}).cast(), 0u); + ASSERT_EQ(type.data("max"_hs).get(entt::meta_any{}).cast(), 128u); } TEST_F(MetaType, Variables) { diff --git a/test/example/entity_copy.cpp b/test/example/entity_copy.cpp index f5a5f6a3b..4d1284a1f 100644 --- a/test/example/entity_copy.cpp +++ b/test/example/entity_copy.cpp @@ -106,7 +106,7 @@ TYPED_TEST(EntityCopy, CrossRegistry) { if(!other) { using namespace entt::literals; - entt::resolve(storage.info()).invoke("storage"_hs, nullptr, entt::forward_as_meta(dst), id); + entt::resolve(storage.info()).invoke("storage"_hs, entt::meta_any{}, entt::forward_as_meta(dst), id); other = dst.storage(id); }