From 258aabbde0dafd60f188da7b45c77d080f39eb96 Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Tue, 5 Nov 2024 22:41:45 +0800 Subject: [PATCH] fix(typetraits): fix CCommonType is incorrect for void --- Redcraft.Utility/Source/Public/TypeTraits/Common.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Redcraft.Utility/Source/Public/TypeTraits/Common.h b/Redcraft.Utility/Source/Public/TypeTraits/Common.h index 4cee50a..581dbfb 100644 --- a/Redcraft.Utility/Source/Public/TypeTraits/Common.h +++ b/Redcraft.Utility/Source/Public/TypeTraits/Common.h @@ -57,7 +57,7 @@ template concept CConditionalType = requires { typename template requires (CDecayed && !CBasicCommonType && CConditionalType) struct TCommonTypeImpl { using Type = TDecay() : DeclVal())>; }; -// Otherwise, if TDecay() : DeclVal())> is a valid Type, +// Otherwise, if TDecay() : DeclVal())> is a valid Type, // where CRT and CRU are const TRemoveReference& and const TRemoveReference& respectively, the member Type denotes that Type template concept CConditionalCRefType = requires { typename TDecay&>() : DeclVal&>())>; }; template requires (CDecayed && !CBasicCommonType && !CConditionalType && CConditionalCRefType) @@ -182,9 +182,8 @@ concept CCommonReference = template concept CCommonType = - requires { typename TCommonType; } - && (true && ... && CConstructibleFrom, Ts&&>) - && CCommonReference && CCommonReference&, TCommonReference>; + requires { typename TCommonType; (static_cast>(DeclVal()), ...); } + && CCommonReference...> && CCommonReference>, TCommonReference...>>; NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Redcraft)