|
|
@@ -276,21 +276,21 @@ TEST(Delegate, DeductionGuide) {
|
|
|
const entt::delegate data_member_v_const{entt::connect_arg<&const_nonconst_noexcept::v>, &std::as_const(functor)};
|
|
|
const entt::delegate lambda{+[](const void *, int) { return 0; }};
|
|
|
|
|
|
- testing::StaticAssertTypeEq<typename decltype(plain_func)::type, int(const int &)>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(sum_func_with_ref)::type, int(int)>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(sum_func_with_const_ref)::type, int(int)>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(sum_func_with_ptr)::type, int(int)>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(sum_func_with_const_ptr)::type, int(int)>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(member_func_f)::type, void()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(member_func_g)::type, void()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(member_func_h)::type, void()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(member_func_h_const)::type, void()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(member_func_i)::type, void()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(member_func_i_const)::type, void()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(data_member_u)::type, int()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(data_member_v)::type, const int()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(data_member_v_const)::type, const int()>();
|
|
|
- testing::StaticAssertTypeEq<typename decltype(lambda)::type, int(int)>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(plain_func)::type, int(const int &)>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(sum_func_with_ref)::type, int(int)>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(sum_func_with_const_ref)::type, int(int)>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(sum_func_with_ptr)::type, int(int)>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(sum_func_with_const_ptr)::type, int(int)>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(member_func_f)::type, void()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(member_func_g)::type, void()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(member_func_h)::type, void()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(member_func_h_const)::type, void()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(member_func_i)::type, void()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(member_func_i_const)::type, void()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(data_member_u)::type, int()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(data_member_v)::type, const int()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(data_member_v_const)::type, const int()>();
|
|
|
+ testing::StaticAssertTypeEq<decltype(lambda)::type, int(int)>();
|
|
|
|
|
|
ASSERT_TRUE(plain_func);
|
|
|
ASSERT_TRUE(sum_func_with_ref);
|
|
|
@@ -394,7 +394,8 @@ TEST(Delegate, Constructors) {
|
|
|
const entt::delegate<int(int)> func{entt::connect_arg<&power_of_two>};
|
|
|
const entt::delegate<int(int)> ref{entt::connect_arg<&sum_with_ref>, value};
|
|
|
const entt::delegate<int(int)> ptr{entt::connect_arg<&sum_with_ptr>, &value};
|
|
|
- const entt::delegate<int(int)> member{entt::connect_arg<&delegate_functor::operator()>, functor};
|
|
|
+ const entt::delegate<int(int)> member { entt::connect_arg<&delegate_functor::operator()>,
|
|
|
+ functor };
|
|
|
|
|
|
ASSERT_FALSE(empty);
|
|
|
|
|
|
@@ -415,7 +416,8 @@ TEST(Delegate, VoidVsNonVoidReturnType) {
|
|
|
delegate_functor functor;
|
|
|
|
|
|
const entt::delegate<void(int)> func{entt::connect_arg<&power_of_two>};
|
|
|
- const entt::delegate<void(int)> member{entt::connect_arg<&delegate_functor::operator()>, &functor};
|
|
|
+ const entt::delegate<void(int)> member { entt::connect_arg<&delegate_functor::operator()>,
|
|
|
+ &functor };
|
|
|
const entt::delegate<void(int)> cmember{entt::connect_arg<&delegate_functor::mul>, &std::as_const(functor)};
|
|
|
|
|
|
ASSERT_TRUE(func);
|