Преглед изворни кода

meta: some changes to make tests compile with C++20 (MSVC)

Michele Caini пре 4 година
родитељ
комит
238170d0e2

+ 3 - 3
test/entt/meta/meta_any.cpp

@@ -66,18 +66,18 @@ struct MetaAny: ::testing::Test {
 
         entt::meta<empty_t>()
             .type("empty"_hs)
-            .dtor<&empty_t::destroy>();
+            .dtor<empty_t::destroy>();
 
         entt::meta<fat_t>()
             .type("fat"_hs)
             .base<empty_t>()
-            .dtor<&fat_t::destroy>();
+            .dtor<fat_t::destroy>();
 
         entt::meta<clazz_t>()
             .type("clazz"_hs)
             .data<&clazz_t::value>("value"_hs)
             .func<&clazz_t::member>("member"_hs)
-            .func<&clazz_t::func>("func"_hs);
+            .func<clazz_t::func>("func"_hs);
 
         empty_t::destroy_counter = 0;
         empty_t::destructor_counter = 0;

+ 1 - 1
test/entt/meta/meta_conv.cpp

@@ -22,7 +22,7 @@ struct MetaConv: ::testing::Test {
         entt::meta<clazz_t>()
             .type("clazz"_hs)
             .conv<int>()
-            .conv<&conv_to_double>();
+            .conv<conv_to_double>();
     }
 
     void TearDown() override {

+ 3 - 3
test/entt/meta/meta_ctor.cpp

@@ -39,7 +39,7 @@ struct MetaCtor: ::testing::Test {
         entt::meta<double>()
             .type("double"_hs)
             .conv<int>()
-            .ctor<&double_factory>();
+            .ctor<double_factory>();
 
         entt::meta<derived_t>()
             .type("derived"_hs)
@@ -50,8 +50,8 @@ struct MetaCtor: ::testing::Test {
             .ctor<&entt::registry::emplace_or_replace<clazz_t, const int &, const char &>, entt::as_ref_t>()
             .ctor<const base_t &, int>()
             .ctor<const int &, char>().prop(3, false)
-            .ctor<entt::overload<clazz_t(int)>(&clazz_t::factory)>().prop('c', 42)
-            .ctor<entt::overload<clazz_t(base_t, int, int)>(&clazz_t::factory)>();
+            .ctor<entt::overload<clazz_t(int)>(clazz_t::factory)>().prop('c', 42)
+            .ctor<entt::overload<clazz_t(base_t, int, int)>(clazz_t::factory)>();
     }
 
     void TearDown() override {

+ 3 - 2
test/entt/meta/meta_data.cpp

@@ -6,6 +6,7 @@
 
 struct base_t {
     virtual ~base_t() = default;
+
     static void destroy(base_t &) {
         ++counter;
     }
@@ -82,13 +83,13 @@ struct MetaData: ::testing::Test {
 
         entt::meta<base_t>()
             .type("base"_hs)
-            .dtor<&base_t::destroy>()
+            .dtor<base_t::destroy>()
             .data<&base_t::value>("value"_hs);
 
         entt::meta<derived_t>()
             .type("derived"_hs)
             .base<base_t>()
-            .dtor<&derived_t::destroy>();
+            .dtor<derived_t::destroy>();
 
         entt::meta<clazz_t>()
             .type("clazz"_hs)

+ 2 - 2
test/entt/meta/meta_dtor.cpp

@@ -27,7 +27,7 @@ struct MetaDtor: ::testing::Test {
 
         entt::meta<clazz_t>()
             .type("clazz"_hs)
-            .dtor<&clazz_t::destroy_decr>();
+            .dtor<clazz_t::destroy_decr>();
 
         clazz_t::counter = 0;
     }
@@ -104,7 +104,7 @@ TEST_F(MetaDtor, ReRegistration) {
 
     ASSERT_NE(node->dtor, nullptr);
 
-    entt::meta<clazz_t>().dtor<&clazz_t::destroy_incr>();
+    entt::meta<clazz_t>().dtor<clazz_t::destroy_incr>();
     entt::resolve<clazz_t>().construct().reset();
 
     ASSERT_EQ(clazz_t::counter, 2);

+ 5 - 4
test/entt/meta/meta_func.cpp

@@ -8,6 +8,7 @@
 
 struct base_t {
     virtual ~base_t() = default;
+
     static void destroy(base_t &) {
         ++counter;
     }
@@ -71,13 +72,13 @@ struct MetaFunc: ::testing::Test {
 
         entt::meta<base_t>()
             .type("base"_hs)
-            .dtor<&base_t::destroy>()
+            .dtor<base_t::destroy>()
             .func<&base_t::func>("func"_hs);
 
         entt::meta<derived_t>()
             .type("derived"_hs)
             .base<base_t>()
-            .dtor<&derived_t::destroy>();
+            .dtor<derived_t::destroy>();
 
         entt::meta<func_t>()
             .type("func"_hs)
@@ -86,8 +87,8 @@ struct MetaFunc: ::testing::Test {
             .func<entt::overload<int(int, int)>(&func_t::f)>("f2"_hs).prop(true, false)
             .func<entt::overload<int(int) const>(&func_t::f)>("f1"_hs).prop(true, false)
             .func<&func_t::g>("g"_hs).prop(true, false)
-            .func<&func_t::h>("h"_hs).prop(true, false)
-            .func<&func_t::k>("k"_hs).prop(true, false)
+            .func<func_t::h>("h"_hs).prop(true, false)
+            .func<func_t::k>("k"_hs).prop(true, false)
             .func<&func_t::v, entt::as_void_t>("v"_hs)
             .func<&func_t::a, entt::as_ref_t>("a"_hs)
             .func<&func_t::a, entt::as_cref_t>("ca"_hs);

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

@@ -99,7 +99,7 @@ struct MetaType: ::testing::Test {
         entt::meta<double>()
             .type("double"_hs)
             .conv<int>()
-            .data<&set<double>, &get<double>>("var"_hs);
+            .data<set<double>, get<double>>("var"_hs);
 
         entt::meta<unsigned int>()
             .type("unsigned int"_hs)
@@ -144,7 +144,7 @@ struct MetaType: ::testing::Test {
                 .prop([]() { return property_t::key_only; })
             .data<property_t::list>("list"_hs)
                .props(std::make_pair(property_t::random, false), std::make_pair(property_t::value, 0), property_t::key_only)
-            .data<&set<property_t>, &get<property_t>>("var"_hs);
+            .data<set<property_t>, get<property_t>>("var"_hs);
 
         entt::meta<clazz_t>()
             .type("clazz"_hs)
@@ -152,7 +152,7 @@ struct MetaType: ::testing::Test {
             .ctor<const base_t &, int>()
             .data<&clazz_t::value>("value"_hs)
             .func<&clazz_t::member>("member"_hs)
-            .func<&clazz_t::func>("func"_hs);
+            .func<clazz_t::func>("func"_hs);
     }
 
     void TearDown() override {