refactor(*): make the template class concept indistinguishable from cv-qualified

This commit is contained in:
_Redstone_c_ 2022-11-17 20:57:54 +08:00
parent 9a3c957b38
commit f96c000b9e
7 changed files with 24 additions and 24 deletions

View File

@ -501,7 +501,7 @@ template <CAnyCustomStorage StorageType> struct TIsTAny<TAny<StorageType>> : FTr
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> template <typename T>
concept CTAny = NAMESPACE_PRIVATE::TIsTAny<T>::Value; concept CTAny = NAMESPACE_PRIVATE::TIsTAny<TRemoveCV<T>>::Value;
using FAny = TAny<>; using FAny = TAny<>;

View File

@ -35,9 +35,9 @@ template <typename F> struct TIsTUniqueFunction<TUniqueFunction<F>> : FTrue { }
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> concept CTFunctionRef = NAMESPACE_PRIVATE::TIsTFunctionRef<T>::Value; template <typename T> concept CTFunctionRef = NAMESPACE_PRIVATE::TIsTFunctionRef<TRemoveCV<T>>::Value;
template <typename T> concept CTFunction = NAMESPACE_PRIVATE::TIsTFunction<T>::Value; template <typename T> concept CTFunction = NAMESPACE_PRIVATE::TIsTFunction<TRemoveCV<T>>::Value;
template <typename T> concept CTUniqueFunction = NAMESPACE_PRIVATE::TIsTUniqueFunction<T>::Value; template <typename T> concept CTUniqueFunction = NAMESPACE_PRIVATE::TIsTUniqueFunction<TRemoveCV<T>>::Value;
NAMESPACE_PRIVATE_BEGIN NAMESPACE_PRIVATE_BEGIN

View File

@ -309,7 +309,7 @@ template <typename T> struct TIsTOptional<TOptional<T>> : FTrue { };
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> concept CTOptional = NAMESPACE_PRIVATE::TIsTOptional<T>::Value; template <typename T> concept CTOptional = NAMESPACE_PRIVATE::TIsTOptional<TRemoveCV<T>>::Value;
NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Utility)
NAMESPACE_MODULE_END(Redcraft) NAMESPACE_MODULE_END(Redcraft)

View File

@ -116,7 +116,7 @@ template <typename T> struct TUnwrapRefDecayImpl { using Type = typename TUnwrap
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> template <typename T>
concept CTReferenceWrapper = NAMESPACE_PRIVATE::TIsTReferenceWrapperImpl<T>::Value; concept CTReferenceWrapper = NAMESPACE_PRIVATE::TIsTReferenceWrapperImpl<TRemoveCV<T>>::Value;
template <typename T> template <typename T>
using TUnwrapReference = typename NAMESPACE_PRIVATE::TUnwrapReferenceImpl<T>::Type; using TUnwrapReference = typename NAMESPACE_PRIVATE::TUnwrapReferenceImpl<T>::Type;

View File

@ -289,16 +289,16 @@ public:
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> template <typename T>
concept CTTuple = NAMESPACE_PRIVATE::TIsTTuple<T>::Value; concept CTTuple = NAMESPACE_PRIVATE::TIsTTuple<TRemoveCV<T>>::Value;
template <typename TupleType> template <CTTuple T>
inline constexpr size_t TTupleArity = NAMESPACE_PRIVATE::TTupleArityImpl<TupleType>::Value; inline constexpr size_t TTupleArity = NAMESPACE_PRIVATE::TTupleArityImpl<T>::Value;
template <typename T, typename TupleType> template <typename T, CTTuple U>
inline constexpr size_t TTupleIndex = NAMESPACE_PRIVATE::TTupleIndexImpl<T, TupleType>::Value; inline constexpr size_t TTupleIndex = NAMESPACE_PRIVATE::TTupleIndexImpl<T, U>::Value;
template <size_t I, typename TupleType> template <size_t I, CTTuple U>
using TTupleElement = typename NAMESPACE_PRIVATE::TTupleElementImpl<I, TupleType>::Type; using TTupleElement = typename NAMESPACE_PRIVATE::TTupleElementImpl<I, U>::Type;
template <typename... Ts> template <typename... Ts>
class TTuple : public NAMESPACE_PRIVATE::TTupleImpl<TIndexSequenceFor<Ts...>, Ts...> class TTuple : public NAMESPACE_PRIVATE::TTupleImpl<TIndexSequenceFor<Ts...>, Ts...>
@ -607,10 +607,10 @@ constexpr TCommonComparisonCategory<TSynthThreeWayResult<LHSTypes, RHSTypes>...>
return NAMESPACE_PRIVATE::TTupleThreeWay<R, TMakeIndexSequence<sizeof...(LHSTypes)>>::F(LHS, RHS); return NAMESPACE_PRIVATE::TTupleThreeWay<R, TMakeIndexSequence<sizeof...(LHSTypes)>>::F(LHS, RHS);
} }
template <typename F> requires (CInvocable<F>) template <typename F>
constexpr void VisitTuple(F&& Func) { } constexpr void VisitTuple(F&& Func) { }
template <typename F, typename FirstTupleType, typename... TupleTypes> template <typename F, typename FirstTupleType, typename... TupleTypes> requires (CTTuple<TRemoveReference<FirstTupleType>> && (true && ... && CTTuple<TRemoveReference<TupleTypes>>))
constexpr void VisitTuple(F&& Func, FirstTupleType&& FirstTuple, TupleTypes&&... Tuples) constexpr void VisitTuple(F&& Func, FirstTupleType&& FirstTuple, TupleTypes&&... Tuples)
{ {
NAMESPACE_PRIVATE::TTupleVisitImpl<TMakeIndexSequence<TTupleArity<TRemoveReference<FirstTupleType>>>> NAMESPACE_PRIVATE::TTupleVisitImpl<TMakeIndexSequence<TTupleArity<TRemoveReference<FirstTupleType>>>>

View File

@ -137,16 +137,16 @@ struct TVariantSelectedType<T>
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> template <typename T>
concept CTVariant = NAMESPACE_PRIVATE::TIsTVariant<T>::Value; concept CTVariant = NAMESPACE_PRIVATE::TIsTVariant<TRemoveCV<T>>::Value;
template <typename VariantType> template <CTVariant T>
inline constexpr size_t TVariantNum = NAMESPACE_PRIVATE::TVariantNumImpl<VariantType>::Value; inline constexpr size_t TVariantNum = NAMESPACE_PRIVATE::TVariantNumImpl<T>::Value;
template <typename T, typename VariantType> template <typename T, CTVariant U>
inline constexpr size_t TVariantIndex = NAMESPACE_PRIVATE::TVariantIndexImpl<T, VariantType>::Value; inline constexpr size_t TVariantIndex = NAMESPACE_PRIVATE::TVariantIndexImpl<T, U>::Value;
template <size_t I, typename VariantType> template <size_t I, CTVariant U>
using TVariantAlternative = typename NAMESPACE_PRIVATE::TVariantAlternativeImpl<I, VariantType>::Type; using TVariantAlternative = typename NAMESPACE_PRIVATE::TVariantAlternativeImpl<I, U>::Type;
template <typename... Ts> requires (sizeof...(Ts) > 0 && (true && ... && CDestructible<Ts>)) template <typename... Ts> requires (sizeof...(Ts) > 0 && (true && ... && CDestructible<Ts>))
class TVariant class TVariant

View File

@ -17,8 +17,8 @@ template <size_t I> struct TIsTInPlaceIndex<TInPlaceIndex<I>> : FTrue { };
NAMESPACE_PRIVATE_END NAMESPACE_PRIVATE_END
template <typename T> concept CTInPlaceType = NAMESPACE_PRIVATE::TIsTInPlaceType<T>::Value; template <typename T> concept CTInPlaceType = NAMESPACE_PRIVATE::TIsTInPlaceType<TRemoveCV<T>>::Value;
template <typename T> concept CTInPlaceIndex = NAMESPACE_PRIVATE::TIsTInPlaceIndex<T>::Value; template <typename T> concept CTInPlaceIndex = NAMESPACE_PRIVATE::TIsTInPlaceIndex<TRemoveCV<T>>::Value;
NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Utility)
NAMESPACE_MODULE_END(Redcraft) NAMESPACE_MODULE_END(Redcraft)