소스 검색

meta: support {} on static calls

skypjack 5 달 전
부모
커밋
c777cda857

+ 0 - 1
TODO

@@ -36,4 +36,3 @@ TODO:
 * parent link in data and func meta objects
 * remove operator-> from meta_handle, only allow try_cast
 * update natvis and doc for meta (meta_handle and the like changed quite a lot)
-* introduce a placeholder for entt::meta_handle{} (static calls)

+ 8 - 8
src/entt/meta/meta.hpp

@@ -836,7 +836,7 @@ public:
      * @param value Parameter to use to set the underlying variable.
      * @return True in case of success, false otherwise.
      */
-    template<typename Instance, typename Type>
+    template<typename Instance = meta_handle, typename Type>
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     bool set(Instance &&instance, Type &&value) const {
         return node_or_assert().set(meta_handle{*ctx, std::forward<Instance>(instance)}, meta_any{*ctx, std::forward<Type>(value)});
@@ -848,7 +848,7 @@ public:
      * @param instance An instance that fits the underlying type.
      * @return A wrapper containing the value of the underlying variable.
      */
-    template<typename Instance>
+    template<typename Instance = meta_handle>
     [[nodiscard]] meta_any get(Instance &&instance) const {
         return node_or_assert().get(meta_handle{*ctx, std::forward<Instance>(instance)});
     }
@@ -986,7 +986,7 @@ public:
      * @param sz Number of parameters to use to invoke the function.
      * @return A wrapper containing the returned value, if any.
      */
-    template<typename Instance>
+    template<typename Instance = meta_handle>
     meta_any invoke(Instance &&instance, meta_any *const args, const size_type sz) const {
         return (sz == arity()) ? node_or_assert().invoke(meta_handle{*ctx, std::forward<Instance>(instance)}, args) : meta_any{meta_ctx_arg, *ctx};
     }
@@ -999,7 +999,7 @@ public:
      * @param args Parameters to use to invoke the function.
      * @return A wrapper containing the returned value, if any.
      */
-    template<typename Instance, typename... Args>
+    template<typename Instance = meta_handle, typename... Args>
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     meta_any invoke(Instance &&instance, Args &&...args) const {
         return (sizeof...(Args) == arity()) ? node_or_assert().invoke(meta_handle{*ctx, std::forward<Instance>(instance)}, std::array<meta_any, sizeof...(Args)>{meta_any{*ctx, std::forward<Args>(args)}...}.data()) : meta_any{meta_ctx_arg, *ctx};
@@ -1416,7 +1416,7 @@ public:
      * @param sz Number of parameters to use to invoke the function.
      * @return A wrapper containing the returned value, if any.
      */
-    template<typename Instance>
+    template<typename Instance = meta_handle>
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     meta_any invoke(const id_type id, Instance &&instance, meta_any *const args, const size_type sz) const {
         meta_handle wrapped{*ctx, std::forward<Instance>(instance)};
@@ -1447,7 +1447,7 @@ public:
      * @param args Parameters to use to invoke the function.
      * @return A wrapper containing the returned value, if any.
      */
-    template<typename Instance, typename... Args>
+    template<typename Instance = meta_handle, typename... Args>
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     meta_any invoke(const id_type id, Instance &&instance, Args &&...args) const {
         return invoke(id, std::forward<Instance>(instance), std::array<meta_any, sizeof...(Args)>{meta_any{*ctx, std::forward<Args>(args)}...}.data(), sizeof...(Args));
@@ -1462,7 +1462,7 @@ public:
      * @param value Parameter to use to set the underlying variable.
      * @return True in case of success, false otherwise.
      */
-    template<typename Instance, typename Type>
+    template<typename Instance = meta_handle, typename Type>
     // NOLINTNEXTLINE(modernize-use-nodiscard)
     bool set(const id_type id, Instance &&instance, Type &&value) const {
         const auto candidate = data(id);
@@ -1476,7 +1476,7 @@ public:
      * @param instance An instance that fits the underlying type.
      * @return A wrapper containing the value of the underlying variable.
      */
-    template<typename Instance>
+    template<typename Instance = meta_handle>
     [[nodiscard]] meta_any get(const id_type id, Instance &&instance) const {
         const auto candidate = data(id);
         return candidate ? candidate.get(std::forward<Instance>(instance)) : meta_any{meta_ctx_arg, *ctx};

+ 1 - 1
src/entt/tools/davey.hpp

@@ -42,7 +42,7 @@ static void present_element(const meta_any &obj, OnEntity on_entity) {
             const char *as_string = nullptr;
 
             for(auto [id, curr]: type.data()) {
-                if(curr.get(entt::meta_handle{}) == elem) {
+                if(curr.get({}) == elem) {
                     as_string = curr.name();
                     break;
                 }

+ 32 - 32
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(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.data("value"_hs).type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.data("value"_hs).type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.data("value"_hs).type().data("marker"_hs).get({}).cast<int>(), local_marker);
 
-    ASSERT_EQ(global.data("rw"_hs).arg(0u).data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.data("rw"_hs).arg(0u).data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.data("rw"_hs).arg(0u).data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.data("rw"_hs).arg(0u).data("marker"_hs).get({}).cast<int>(), 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(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.func("func"_hs).arg(0u).data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.func("func"_hs).arg(0u).data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.func("func"_hs).arg(0u).data("marker"_hs).get({}).cast<int>(), local_marker);
 
-    ASSERT_EQ(global.func("func"_hs).ret().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.func("func"_hs).ret().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.func("func"_hs).ret().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.func("func"_hs).ret().data("marker"_hs).get({}).cast<int>(), 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<int>(ctx()));
     ASSERT_EQ(local.template_arg(1u), entt::resolve<char>(ctx()));
 
-    ASSERT_EQ(global.template_arg(0u).data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.template_arg(0u).data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.template_arg(0u).data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.template_arg(0u).data("marker"_hs).get({}).cast<int>(), 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(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ((*local).type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ((*global).type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ((*local).type().data("marker"_hs).get({}).cast<int>(), 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(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.key_type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.key_type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.key_type().data("marker"_hs).get({}).cast<int>(), local_marker);
 
-    ASSERT_EQ(global.mapped_type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.mapped_type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.mapped_type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.mapped_type().data("marker"_hs).get({}).cast<int>(), local_marker);
 
-    ASSERT_EQ((*global.begin()).first.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ((*local.begin()).first.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ((*global.begin()).first.type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ((*local.begin()).first.type().data("marker"_hs).get({}).cast<int>(), local_marker);
 
-    ASSERT_EQ((*global.begin()).second.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ((*local.begin()).second.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ((*global.begin()).second.type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ((*local.begin()).second.type().data("marker"_hs).get({}).cast<int>(), 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(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.value_type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.value_type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.value_type().data("marker"_hs).get({}).cast<int>(), local_marker);
 
-    ASSERT_EQ((*global.begin()).type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ((*local.begin()).type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ((*global.begin()).type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ((*local.begin()).type().data("marker"_hs).get({}).cast<int>(), 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(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(ctx_value.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
-    ASSERT_EQ(in_place.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
-    ASSERT_EQ(two_step_local.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(ctx_value.type().data("marker"_hs).get({}).cast<int>(), local_marker);
+    ASSERT_EQ(in_place.type().data("marker"_hs).get({}).cast<int>(), local_marker);
+    ASSERT_EQ(two_step_local.type().data("marker"_hs).get({}).cast<int>(), local_marker);
 }
 
 TEST_F(MetaContext, MetaHandle) {
@@ -468,8 +468,8 @@ TEST_F(MetaContext, MetaHandle) {
     ASSERT_TRUE(global);
     ASSERT_TRUE(ctx_value);
 
-    ASSERT_EQ(global->type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(ctx_value->type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global->type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(ctx_value->type().data("marker"_hs).get({}).cast<int>(), local_marker);
 }
 
 TEST_F(MetaContext, ForwardAsMeta) {
@@ -481,6 +481,6 @@ TEST_F(MetaContext, ForwardAsMeta) {
     ASSERT_TRUE(global);
     ASSERT_TRUE(local);
 
-    ASSERT_EQ(global.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), global_marker);
-    ASSERT_EQ(local.type().data("marker"_hs).get(entt::meta_handle{}).cast<int>(), local_marker);
+    ASSERT_EQ(global.type().data("marker"_hs).get({}).cast<int>(), global_marker);
+    ASSERT_EQ(local.type().data("marker"_hs).get({}).cast<int>(), local_marker);
 }

+ 11 - 11
test/entt/meta/meta_data.cpp

@@ -229,9 +229,9 @@ TEST_F(MetaData, Static) {
     ASSERT_EQ(data.arg(0u), entt::resolve<int>());
     ASSERT_FALSE(data.is_const());
     ASSERT_TRUE(data.is_static());
-    ASSERT_EQ(data.get(entt::meta_handle{}).cast<int>(), 2);
-    ASSERT_TRUE(data.set(entt::meta_handle{}, 1));
-    ASSERT_EQ(data.get(entt::meta_handle{}).cast<int>(), 1);
+    ASSERT_EQ(data.get({}).cast<int>(), 2);
+    ASSERT_TRUE(data.set({}, 1));
+    ASSERT_EQ(data.get({}).cast<int>(), 1);
 }
 
 TEST_F(MetaData, ConstStatic) {
@@ -245,9 +245,9 @@ TEST_F(MetaData, ConstStatic) {
     ASSERT_EQ(data.arg(0u), entt::resolve<int>());
     ASSERT_TRUE(data.is_const());
     ASSERT_TRUE(data.is_static());
-    ASSERT_EQ(data.get(entt::meta_handle{}).cast<int>(), 3);
-    ASSERT_FALSE(data.set(entt::meta_handle{}, 1));
-    ASSERT_EQ(data.get(entt::meta_handle{}).cast<int>(), 3);
+    ASSERT_EQ(data.get({}).cast<int>(), 3);
+    ASSERT_FALSE(data.set({}, 1));
+    ASSERT_EQ(data.get({}).cast<int>(), 3);
 }
 
 TEST_F(MetaData, Literal) {
@@ -261,9 +261,9 @@ TEST_F(MetaData, Literal) {
     ASSERT_EQ(data.arg(0u), entt::resolve<char>());
     ASSERT_TRUE(data.is_const());
     ASSERT_TRUE(data.is_static());
-    ASSERT_EQ(data.get(entt::meta_handle{}).cast<char>(), 'c');
-    ASSERT_FALSE(data.set(entt::meta_handle{}, 'a'));
-    ASSERT_EQ(data.get(entt::meta_handle{}).cast<char>(), 'c');
+    ASSERT_EQ(data.get({}).cast<char>(), 'c');
+    ASSERT_FALSE(data.set({}, 'a'));
+    ASSERT_EQ(data.get({}).cast<char>(), '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<clazz>().data("i"_hs).set(entt::meta_handle{}, 'c'));
+    ASSERT_FALSE(entt::resolve<clazz>().data("i"_hs).set({}, '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(entt::meta_handle{}));
+    ASSERT_FALSE(data.get({}));
 }
 
 TEST_F(MetaData, Array) {

+ 5 - 5
test/entt/meta/meta_factory.cpp

@@ -195,8 +195,8 @@ TEST_F(MetaFactory, DataPointer) {
     type = entt::resolve<int>();
 
     ASSERT_TRUE(type.data("value"_hs));
-    ASSERT_EQ(type.get("value"_hs, entt::meta_handle{}), value);
-    ASSERT_TRUE(type.set("value"_hs, entt::meta_handle{}, value));
+    ASSERT_EQ(type.get("value"_hs, {}), value);
+    ASSERT_TRUE(type.set("value"_hs, {}, value));
 }
 
 TEST_F(MetaFactory, DataValue) {
@@ -212,8 +212,8 @@ TEST_F(MetaFactory, DataValue) {
     type = entt::resolve<int>();
 
     ASSERT_TRUE(type.data("value"_hs));
-    ASSERT_EQ(type.get("value"_hs, entt::meta_handle{}), value);
-    ASSERT_FALSE(type.set("value"_hs, entt::meta_handle{}, value));
+    ASSERT_EQ(type.get("value"_hs, {}), value);
+    ASSERT_FALSE(type.set("value"_hs, {}, 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<int>(), instance.get_int());
-    ASSERT_FALSE(type.invoke("func"_hs, entt::meta_handle{}));
+    ASSERT_FALSE(type.invoke("func"_hs, {}));
 }
 
 TEST_F(MetaFactory, FuncOverload) {

+ 9 - 9
test/entt/meta/meta_func.cpp

@@ -301,8 +301,8 @@ TEST_F(MetaFunc, Static) {
     ASSERT_EQ(func.arg(1u), entt::resolve<function>());
     ASSERT_FALSE(func.arg(2u));
 
-    auto any = func.invoke(entt::meta_handle{}, 3, entt::forward_as_meta(instance));
-    auto empty = func.invoke(entt::meta_handle{}, derived{}, entt::forward_as_meta(instance));
+    auto any = func.invoke({}, 3, entt::forward_as_meta(instance));
+    auto empty = func.invoke({}, 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<function>());
     ASSERT_FALSE(func.arg(2u));
 
-    auto any = func.invoke(entt::meta_handle{}, 3, entt::forward_as_meta(instance));
+    auto any = func.invoke({}, 3, entt::forward_as_meta(instance));
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.type(), entt::resolve<void>());
@@ -347,7 +347,7 @@ TEST_F(MetaFunc, StaticAsMember) {
     ASSERT_EQ(func.arg(0u), entt::resolve<int>());
     ASSERT_FALSE(func.arg(1u));
 
-    ASSERT_FALSE(func.invoke(entt::meta_handle{}, 3));
+    ASSERT_FALSE(func.invoke({}, 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<int>());
     ASSERT_FALSE(func.arg(0u));
 
-    ASSERT_FALSE(func.invoke(entt::meta_handle{}));
+    ASSERT_FALSE(func.invoke({}));
     ASSERT_TRUE(func.invoke(instance));
 
     ASSERT_TRUE(any);
@@ -391,7 +391,7 @@ TEST_F(MetaFunc, NonClassTypeMember) {
     ASSERT_EQ(func.ret(), entt::resolve<double>());
     ASSERT_FALSE(func.arg(0u));
 
-    ASSERT_FALSE(func.invoke(entt::meta_handle{}));
+    ASSERT_FALSE(func.invoke({}));
     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(entt::meta_handle{}, entt::forward_as_meta(value), entt::forward_as_meta(instance)).cast<int>(), 8);
-    ASSERT_EQ(func.invoke(entt::meta_handle{}, any.as_ref(), entt::forward_as_meta(instance)).cast<int>(), 6);
+    ASSERT_EQ(func.invoke({}, entt::forward_as_meta(value), entt::forward_as_meta(instance)).cast<int>(), 8);
+    ASSERT_EQ(func.invoke({}, any.as_ref(), entt::forward_as_meta(instance)).cast<int>(), 6);
     ASSERT_EQ(any.cast<int>(), 6);
     ASSERT_EQ(value, 8);
 }
@@ -589,7 +589,7 @@ TEST_F(MetaFunc, ExternalMemberFunction) {
 
     ASSERT_FALSE(registry.all_of<function>(entity));
 
-    func.invoke(entt::meta_handle{}, entt::forward_as_meta(registry), entity);
+    func.invoke({}, entt::forward_as_meta(registry), entity);
 
     ASSERT_TRUE(registry.all_of<function>(entity));
 }

+ 1 - 1
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(entt::meta_handle{}).cast<int>(), 2);
+        ASSERT_EQ(data.get({}).cast<int>(), 2);
     }
 }

+ 20 - 20
test/entt/meta/meta_type.cpp

@@ -251,12 +251,12 @@ TEST_F(MetaType, SafeWhenEmpty) {
     ASSERT_FALSE(type.from_void(static_cast<void *>(&type), true));
     ASSERT_FALSE(type.from_void(static_cast<const void *>(nullptr)));
     ASSERT_FALSE(type.from_void(static_cast<const void *>(&type)));
-    ASSERT_FALSE(type.invoke("func"_hs, entt::meta_handle{}, args, 0u));
-    ASSERT_FALSE(type.invoke("func"_hs, entt::meta_handle{}, args, 1u));
-    ASSERT_FALSE(type.invoke("func"_hs, entt::meta_handle{}));
-    ASSERT_FALSE(type.invoke("func"_hs, entt::meta_handle{}, 'c'));
-    ASSERT_FALSE(type.set("data"_hs, entt::meta_handle{}, 0));
-    ASSERT_FALSE(type.get("data"_hs, entt::meta_handle{}));
+    ASSERT_FALSE(type.invoke("func"_hs, {}, args, 0u));
+    ASSERT_FALSE(type.invoke("func"_hs, {}, args, 1u));
+    ASSERT_FALSE(type.invoke("func"_hs, {}));
+    ASSERT_FALSE(type.invoke("func"_hs, {}, 'c'));
+    ASSERT_FALSE(type.set("data"_hs, {}, 0));
+    ASSERT_FALSE(type.get("data"_hs, {}));
     ASSERT_EQ(type.traits<test::meta_traits>(), test::meta_traits::none);
     ASSERT_EQ(static_cast<const char *>(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(entt::meta_handle{}));
+    ASSERT_TRUE(type.func("func"_hs).invoke({}));
 
     type = entt::resolve<void>();
 
@@ -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, entt::meta_handle{}));
-    ASSERT_FALSE(type.invoke("cnuf"_hs, entt::meta_handle{}));
+    ASSERT_TRUE(type.invoke("func"_hs, {}));
+    ASSERT_FALSE(type.invoke("cnuf"_hs, {}));
 }
 
 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, entt::meta_handle{}, 'c'));
+    ASSERT_FALSE(type.invoke("ylno_esab"_hs, {}, '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(entt::meta_handle{}).cast<property_type>(), property_type::value);
-    ASSERT_EQ(type.data("other"_hs).get(entt::meta_handle{}).cast<property_type>(), property_type::other);
+    ASSERT_EQ(type.data("value"_hs).get({}).cast<property_type>(), property_type::value);
+    ASSERT_EQ(type.data("other"_hs).get({}).cast<property_type>(), property_type::other);
 
-    ASSERT_FALSE(type.data("value"_hs).set(entt::meta_handle{}, property_type::other));
-    ASSERT_FALSE(type.data("other"_hs).set(entt::meta_handle{}, property_type::value));
+    ASSERT_FALSE(type.data("value"_hs).set({}, property_type::other));
+    ASSERT_FALSE(type.data("other"_hs).set({}, property_type::value));
 
-    ASSERT_EQ(type.data("value"_hs).get(entt::meta_handle{}).cast<property_type>(), property_type::value);
-    ASSERT_EQ(type.data("other"_hs).get(entt::meta_handle{}).cast<property_type>(), property_type::other);
+    ASSERT_EQ(type.data("value"_hs).get({}).cast<property_type>(), property_type::value);
+    ASSERT_EQ(type.data("other"_hs).get({}).cast<property_type>(), 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(entt::meta_handle{}, 128u));
-    ASSERT_FALSE(type.data("max"_hs).set(entt::meta_handle{}, 0u));
+    ASSERT_FALSE(type.data("min"_hs).set({}, 128u));
+    ASSERT_FALSE(type.data("max"_hs).set({}, 0u));
 
-    ASSERT_EQ(type.data("min"_hs).get(entt::meta_handle{}).cast<unsigned int>(), 0u);
-    ASSERT_EQ(type.data("max"_hs).get(entt::meta_handle{}).cast<unsigned int>(), 128u);
+    ASSERT_EQ(type.data("min"_hs).get({}).cast<unsigned int>(), 0u);
+    ASSERT_EQ(type.data("max"_hs).get({}).cast<unsigned int>(), 128u);
 }
 
 TEST_F(MetaType, Variables) {

+ 1 - 1
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, entt::meta_handle{}, entt::forward_as_meta(dst), id);
+                entt::resolve(storage.info()).invoke("storage"_hs, {}, entt::forward_as_meta(dst), id);
                 other = dst.storage(id);
             }