|
|
|
@ -21,42 +21,107 @@ struct TTuple;
|
|
|
|
|
|
|
|
|
|
NAMESPACE_PRIVATE_BEGIN
|
|
|
|
|
|
|
|
|
|
template <typename T > struct TIsTTuple : FFalse { };
|
|
|
|
|
template <typename... Types> struct TIsTTuple<TTuple<Types...>> : FTrue { };
|
|
|
|
|
|
|
|
|
|
struct FForwardingConstructor { explicit FForwardingConstructor() = default; };
|
|
|
|
|
struct FOtherTupleConstructor { explicit FOtherTupleConstructor() = default; };
|
|
|
|
|
|
|
|
|
|
inline constexpr FForwardingConstructor ForwardingConstructor{ };
|
|
|
|
|
inline constexpr FOtherTupleConstructor OtherTupleConstructor{ };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Types>
|
|
|
|
|
struct TTupleElementIndex;
|
|
|
|
|
template <typename TupleType>
|
|
|
|
|
struct TTupleArityImpl;
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
struct TTupleArityImpl<TTuple<Types...>> : TConstant<size_t, sizeof...(Types)> { };
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
struct TTupleArityImpl<const TTuple<Types...>> : TConstant<size_t, sizeof...(Types)> { };
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
struct TTupleArityImpl<volatile TTuple<Types...>> : TConstant<size_t, sizeof...(Types)> { };
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
struct TTupleArityImpl<const volatile TTuple<Types...>> : TConstant<size_t, sizeof...(Types)> { };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename TupleType>
|
|
|
|
|
struct TTupleIndexImpl;
|
|
|
|
|
|
|
|
|
|
template <typename T, typename U, typename... Types>
|
|
|
|
|
struct TTupleElementIndex<T, U, Types...>
|
|
|
|
|
: TConstant<size_t, CSameAs<T, U> ? 0 : (TTupleElementIndex<T, Types...>::Value == INDEX_NONE
|
|
|
|
|
? INDEX_NONE : TTupleElementIndex<T, Types...>::Value + 1)>
|
|
|
|
|
{ };
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
struct TTupleElementIndex<T> : TConstant<size_t, INDEX_NONE> { };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename... Types>
|
|
|
|
|
struct TTupleElementType;
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename T, typename... Types>
|
|
|
|
|
struct TTupleElementType<I, T, Types...>
|
|
|
|
|
struct TTupleIndexImpl<T, TTuple<U, Types...>> : TConstant<size_t, TTupleIndexImpl<T, TTuple<Types...>>::Value + 1>
|
|
|
|
|
{
|
|
|
|
|
static_assert(I < sizeof...(Types) + 1, "Tuple type index is invalid");
|
|
|
|
|
using Type = TTupleElementType<I - 1, Types...>::Type;
|
|
|
|
|
static_assert(sizeof...(Types) != 0, "Non-existent types in tuple");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Types>
|
|
|
|
|
struct TTupleElementType<0, T, Types...> { using Type = T; };
|
|
|
|
|
struct TTupleIndexImpl<T, TTuple<T, Types...>> : TConstant<size_t, 0>
|
|
|
|
|
{
|
|
|
|
|
static_assert((true && ... && !CSameAs<T, Types>), "Duplicate type in tuple");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
struct TTupleIndexImpl<T, TTuple<>> : TConstant<size_t, INDEX_NONE> { };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Types>
|
|
|
|
|
struct TTupleIndexImpl<T, const TTuple<Types...>> : TTupleIndexImpl<T, TTuple<Types...>> { };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Types>
|
|
|
|
|
struct TTupleIndexImpl<T, volatile TTuple<Types...>> : TTupleIndexImpl<T, TTuple<Types...>> { };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Types>
|
|
|
|
|
struct TTupleIndexImpl<T, const volatile TTuple<Types...>> : TTupleIndexImpl<T, TTuple<Types...>> { };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename TupleType>
|
|
|
|
|
struct TTupleElementImpl;
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename T, typename... Types>
|
|
|
|
|
struct TTupleElementImpl<I, TTuple<T, Types...>>
|
|
|
|
|
{
|
|
|
|
|
static_assert(I < sizeof...(Types) + 1, "Invalid index in tuple");
|
|
|
|
|
using Type = TTupleElementImpl<I - 1, TTuple<Types...>>::Type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template <typename T, typename... Types>
|
|
|
|
|
struct TTupleElementImpl<0, TTuple<T, Types...>> { using Type = T; };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename... Types>
|
|
|
|
|
struct TTupleElementImpl<I, TTuple<Types...>> { };
|
|
|
|
|
|
|
|
|
|
template <>
|
|
|
|
|
struct TTupleElementType<0> { };
|
|
|
|
|
struct TTupleElementImpl<0, TTuple<>> { };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename... Types>
|
|
|
|
|
struct TTupleElementImpl<I, const TTuple<Types...>> { using Type = TAddConst<typename TTupleElementImpl<I, TTuple<Types...>>::Type>; };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename... Types>
|
|
|
|
|
struct TTupleElementImpl<I, volatile TTuple<Types...>> { using Type = TAddVolatile<typename TTupleElementImpl<I, TTuple<Types...>>::Type>; };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename... Types>
|
|
|
|
|
struct TTupleElementImpl<I, const volatile TTuple<Types...>> { using Type = TAddCV<typename TTupleElementImpl<I, TTuple<Types...>>::Type>; };
|
|
|
|
|
|
|
|
|
|
template <bool bTrue, typename... Types>
|
|
|
|
|
struct TTupleConvertCopy : FTrue { };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename U>
|
|
|
|
|
struct TTupleConvertCopy<false, T, U>
|
|
|
|
|
: TBoolConstant<!(CConvertibleTo<const TTuple<U>&, T>
|
|
|
|
|
|| CConstructibleFrom<T, const TTuple<U>&>
|
|
|
|
|
|| CSameAs<T, U>)>
|
|
|
|
|
{ };
|
|
|
|
|
|
|
|
|
|
template <bool bTrue, typename... Types>
|
|
|
|
|
struct TTupleConvertMove : FTrue { };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename U>
|
|
|
|
|
struct TTupleConvertMove<false, T, U>
|
|
|
|
|
: TBoolConstant<!(CConvertibleTo<TTuple<U>&&, T>
|
|
|
|
|
|| CConstructibleFrom<T, TTuple<U>&&>
|
|
|
|
|
|| CSameAs<T, U>)>
|
|
|
|
|
{ };
|
|
|
|
|
|
|
|
|
|
template <typename T, size_t Index>
|
|
|
|
|
struct TTupleElement
|
|
|
|
|
struct TTupleBasicElement
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
@ -66,15 +131,15 @@ private:
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
template <typename Type>
|
|
|
|
|
constexpr TTupleElement(Type&& Arg)
|
|
|
|
|
constexpr TTupleBasicElement(Type&& Arg)
|
|
|
|
|
: Value(Forward<Type>(Arg))
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
TTupleElement() = default;
|
|
|
|
|
TTupleElement(TTupleElement&&) = default;
|
|
|
|
|
TTupleElement(const TTupleElement&) = default;
|
|
|
|
|
TTupleElement& operator=(TTupleElement&&) = default;
|
|
|
|
|
TTupleElement& operator=(const TTupleElement&) = default;
|
|
|
|
|
TTupleBasicElement() = default;
|
|
|
|
|
TTupleBasicElement(TTupleBasicElement&&) = default;
|
|
|
|
|
TTupleBasicElement(const TTupleBasicElement&) = default;
|
|
|
|
|
TTupleBasicElement& operator=(TTupleBasicElement&&) = default;
|
|
|
|
|
TTupleBasicElement& operator=(const TTupleBasicElement&) = default;
|
|
|
|
|
|
|
|
|
|
constexpr T& GetValue() & { return static_cast< T& >(Value); }
|
|
|
|
|
constexpr const T& GetValue() const & { return static_cast<const T& >(Value); }
|
|
|
|
@ -88,23 +153,23 @@ public:
|
|
|
|
|
|
|
|
|
|
#if RS_TUPLE_ELEMENT_STATIC_ALIAS
|
|
|
|
|
|
|
|
|
|
#define DEFINE_TTupleElement(Index, Name) \
|
|
|
|
|
#define DEFINE_TTupleBasicElement(Index, Name) \
|
|
|
|
|
template <typename T> \
|
|
|
|
|
struct TTupleElement<T, Index> \
|
|
|
|
|
struct TTupleBasicElement<T, Index> \
|
|
|
|
|
{ \
|
|
|
|
|
using Name##Type = T; \
|
|
|
|
|
Name##Type Name; \
|
|
|
|
|
\
|
|
|
|
|
template <typename Type> \
|
|
|
|
|
constexpr TTupleElement(Type&& Arg) \
|
|
|
|
|
constexpr TTupleBasicElement(Type&& Arg) \
|
|
|
|
|
: Name(Forward<Type>(Arg)) \
|
|
|
|
|
{ } \
|
|
|
|
|
\
|
|
|
|
|
TTupleElement() = default; \
|
|
|
|
|
TTupleElement(TTupleElement&&) = default; \
|
|
|
|
|
TTupleElement(const TTupleElement&) = default; \
|
|
|
|
|
TTupleElement& operator=(TTupleElement&&) = default; \
|
|
|
|
|
TTupleElement& operator=(const TTupleElement&) = default; \
|
|
|
|
|
TTupleBasicElement() = default; \
|
|
|
|
|
TTupleBasicElement(TTupleBasicElement&&) = default; \
|
|
|
|
|
TTupleBasicElement(const TTupleBasicElement&) = default; \
|
|
|
|
|
TTupleBasicElement& operator=(TTupleBasicElement&&) = default; \
|
|
|
|
|
TTupleBasicElement& operator=(const TTupleBasicElement&) = default; \
|
|
|
|
|
\
|
|
|
|
|
constexpr T& GetValue() & { return static_cast< T& >(Name); } \
|
|
|
|
|
constexpr const T& GetValue() const & { return static_cast<const T& >(Name); } \
|
|
|
|
@ -116,38 +181,38 @@ public:
|
|
|
|
|
constexpr const volatile T&& GetValue() const volatile&& { return static_cast<const volatile T&&>(Name); } \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DEFINE_TTupleElement(0x0, First);
|
|
|
|
|
DEFINE_TTupleElement(0x1, Second);
|
|
|
|
|
DEFINE_TTupleElement(0x2, Third);
|
|
|
|
|
DEFINE_TTupleElement(0x3, Fourth);
|
|
|
|
|
DEFINE_TTupleElement(0x4, Fifth);
|
|
|
|
|
DEFINE_TTupleElement(0x5, Sixth);
|
|
|
|
|
DEFINE_TTupleElement(0x6, Seventh);
|
|
|
|
|
DEFINE_TTupleElement(0x7, Eighth);
|
|
|
|
|
DEFINE_TTupleElement(0x8, Ninth);
|
|
|
|
|
DEFINE_TTupleElement(0x9, Tenth);
|
|
|
|
|
DEFINE_TTupleElement(0xA, Eleventh);
|
|
|
|
|
DEFINE_TTupleElement(0xB, Twelfth);
|
|
|
|
|
DEFINE_TTupleElement(0xC, Thirteenth);
|
|
|
|
|
DEFINE_TTupleElement(0xD, Fourteenth);
|
|
|
|
|
DEFINE_TTupleElement(0xE, Fifteenth);
|
|
|
|
|
DEFINE_TTupleElement(0xF, Sixteenth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x0, First);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x1, Second);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x2, Third);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x3, Fourth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x4, Fifth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x5, Sixth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x6, Seventh);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x7, Eighth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x8, Ninth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0x9, Tenth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0xA, Eleventh);
|
|
|
|
|
DEFINE_TTupleBasicElement(0xB, Twelfth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0xC, Thirteenth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0xD, Fourteenth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0xE, Fifteenth);
|
|
|
|
|
DEFINE_TTupleBasicElement(0xF, Sixteenth);
|
|
|
|
|
|
|
|
|
|
#undef DEFINE_TTupleElement
|
|
|
|
|
#undef DEFINE_TTupleBasicElement
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
constexpr TTuple<typename TUnwrapRefDecay<Types>::Type...> MakeTupleImpl(Types&&... Args)
|
|
|
|
|
constexpr TTuple<TUnwrapRefDecay<Types>...> MakeTupleImpl(Types&&... Args)
|
|
|
|
|
{
|
|
|
|
|
return TTuple<typename TUnwrapRefDecay<Types>::Type...>(Forward<Types>(Args)...);
|
|
|
|
|
return TTuple<TUnwrapRefDecay<Types>...>(Forward<Types>(Args)...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename Indices, typename... Types>
|
|
|
|
|
struct TTupleImpl;
|
|
|
|
|
|
|
|
|
|
template <size_t... Indices, typename... Types>
|
|
|
|
|
struct TTupleImpl<TIndexSequence<Indices...>, Types...> : TTupleElement<Types, Indices>...
|
|
|
|
|
struct TTupleImpl<TIndexSequence<Indices...>, Types...> : TTupleBasicElement<Types, Indices>...
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
@ -155,12 +220,12 @@ protected:
|
|
|
|
|
|
|
|
|
|
template <typename... ArgTypes>
|
|
|
|
|
explicit TTupleImpl(FForwardingConstructor, ArgTypes&&... Args)
|
|
|
|
|
: TTupleElement<Types, Indices>(Forward<ArgTypes>(Args))...
|
|
|
|
|
: TTupleBasicElement<Types, Indices>(Forward<ArgTypes>(Args))...
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
template <typename TupleType>
|
|
|
|
|
explicit TTupleImpl(FOtherTupleConstructor, TupleType&& InValue)
|
|
|
|
|
: TTupleElement<Types, Indices>(Forward<TupleType>(InValue).template GetValue<Indices>())...
|
|
|
|
|
: TTupleBasicElement<Types, Indices>(Forward<TupleType>(InValue).template GetValue<Indices>())...
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
TTupleImpl(const TTupleImpl&) = default;
|
|
|
|
@ -180,7 +245,10 @@ struct TTupleHelper<TIndexSequence<Indices...>>
|
|
|
|
|
template <typename LHSTupleType, typename RHSTupleType>
|
|
|
|
|
static constexpr void Assign(LHSTupleType& LHS, RHSTupleType&& RHS)
|
|
|
|
|
{
|
|
|
|
|
static_assert(sizeof...(Indices) == LHS.ElementSize && LHS.ElementSize == RHS.ElementSize, "Cannot assign tuple from different size");
|
|
|
|
|
static_assert(sizeof...(Indices) == TTupleArityImpl<TRemoveReference<LHSTupleType>>::Value
|
|
|
|
|
&& TTupleArityImpl<TRemoveReference<LHSTupleType>>::Value == TTupleArityImpl<TRemoveReference<RHSTupleType>>::Value,
|
|
|
|
|
"Cannot assign tuple from different size");
|
|
|
|
|
|
|
|
|
|
((LHS.template GetValue<Indices>() = Forward<RHSTupleType>(RHS).template GetValue<Indices>()), ...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -218,6 +286,18 @@ struct TTupleHelper<TIndexSequence<Indices...>>
|
|
|
|
|
|
|
|
|
|
NAMESPACE_PRIVATE_END
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
concept CTTuple = NAMESPACE_PRIVATE::TIsTTuple<T>::Value;
|
|
|
|
|
|
|
|
|
|
template <typename TupleType>
|
|
|
|
|
inline constexpr size_t TTupleArity = NAMESPACE_PRIVATE::TTupleArityImpl<TupleType>::Value;
|
|
|
|
|
|
|
|
|
|
template <typename T, typename TupleType>
|
|
|
|
|
inline constexpr size_t TTupleIndex = NAMESPACE_PRIVATE::TTupleIndexImpl<T, TupleType>::Value;
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename TupleType>
|
|
|
|
|
using TTupleElement = typename NAMESPACE_PRIVATE::TTupleElementImpl<I, TupleType>::Type;
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
struct TTuple : NAMESPACE_PRIVATE::TTupleImpl<TIndexSequenceFor<Types...>, Types...>
|
|
|
|
|
{
|
|
|
|
@ -228,71 +308,32 @@ private:
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
static constexpr size_t ElementSize = sizeof...(Types);
|
|
|
|
|
|
|
|
|
|
template <size_t I> struct TElementType : NAMESPACE_PRIVATE::TTupleElementType<I, Types...> { };
|
|
|
|
|
template <typename T> struct TElementIndex : NAMESPACE_PRIVATE::TTupleElementIndex<T, Types...> { };
|
|
|
|
|
|
|
|
|
|
TTuple() = default;
|
|
|
|
|
|
|
|
|
|
template <typename... ArgTypes> requires (ElementSize > 0) && (sizeof...(ArgTypes) == ElementSize)
|
|
|
|
|
|
|
|
|
|
template <typename... ArgTypes> requires (sizeof...(Types) >= 1) && (sizeof...(ArgTypes) == sizeof...(Types))
|
|
|
|
|
&& (true && ... && CConstructibleFrom<Types, ArgTypes&&>)
|
|
|
|
|
&& (true && ... && CConvertibleTo<ArgTypes&&, Types>)
|
|
|
|
|
constexpr TTuple(ArgTypes&&... Args)
|
|
|
|
|
: Super(NAMESPACE_PRIVATE::ForwardingConstructor, Forward<ArgTypes>(Args)...)
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
template <typename... ArgTypes> requires (ElementSize > 0) && (sizeof...(ArgTypes) == ElementSize)
|
|
|
|
|
&& (true && ... && CConstructibleFrom<Types, ArgTypes&&>)
|
|
|
|
|
&& (!(true && ... && CConvertibleTo<ArgTypes&&, Types>))
|
|
|
|
|
constexpr explicit TTuple(ArgTypes&&... Args)
|
|
|
|
|
constexpr explicit (!(true && ... && CConvertibleTo<ArgTypes&&, Types>)) TTuple(ArgTypes&&... Args)
|
|
|
|
|
: Super(NAMESPACE_PRIVATE::ForwardingConstructor, Forward<ArgTypes>(Args)...)
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == ElementSize)
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == sizeof...(Types))
|
|
|
|
|
&& (true && ... && CConstructibleFrom<Types, const OtherTypes&>)
|
|
|
|
|
&& ((ElementSize != 1) || !(CConvertibleTo<const TTuple<OtherTypes...>&, typename TElementType<0>::Type>
|
|
|
|
|
|| CConstructibleFrom<typename TElementType<0>::Type, const TTuple<OtherTypes...>&>
|
|
|
|
|
|| CSameAs<typename TElementType<0>::Type, typename TTuple<OtherTypes...>::template TElementType<0>::Type>))
|
|
|
|
|
&& (true && ... && CConvertibleTo<OtherTypes&&, Types>)
|
|
|
|
|
constexpr TTuple(const TTuple<OtherTypes...>& InValue)
|
|
|
|
|
&& NAMESPACE_PRIVATE::TTupleConvertCopy<sizeof...(Types) != 1, Types..., OtherTypes...>::Value
|
|
|
|
|
constexpr explicit (!(true && ... && CConvertibleTo<OtherTypes&&, Types>)) TTuple(const TTuple<OtherTypes...>& InValue)
|
|
|
|
|
: Super(NAMESPACE_PRIVATE::OtherTupleConstructor, InValue)
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == ElementSize)
|
|
|
|
|
&& (true && ... && CConstructibleFrom<Types, const OtherTypes&>)
|
|
|
|
|
&& ((ElementSize != 1) || !(CConvertibleTo<const TTuple<OtherTypes...>&, typename TElementType<0>::Type>
|
|
|
|
|
|| CConstructibleFrom<typename TElementType<0>::Type, const TTuple<OtherTypes...>&>
|
|
|
|
|
|| CSameAs<typename TElementType<0>::Type, typename TTuple<OtherTypes...>::template TElementType<0>::Type>))
|
|
|
|
|
&& (!(true && ... && CConvertibleTo<OtherTypes&&, Types>))
|
|
|
|
|
constexpr explicit TTuple(const TTuple<OtherTypes...>& InValue)
|
|
|
|
|
: Super(NAMESPACE_PRIVATE::OtherTupleConstructor, InValue)
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == ElementSize)
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == sizeof...(Types))
|
|
|
|
|
&& (true && ... && CConstructibleFrom<Types, OtherTypes&&>)
|
|
|
|
|
&& ((ElementSize != 1) || !(CConvertibleTo<TTuple<OtherTypes...>&&, typename TElementType<0>::Type>
|
|
|
|
|
|| CConstructibleFrom<typename TElementType<0>::Type, TTuple<OtherTypes...>&&>
|
|
|
|
|
|| CSameAs<typename TElementType<0>::Type, typename TTuple<OtherTypes...>::template TElementType<0>::Type>))
|
|
|
|
|
&& (true && ... && CConvertibleTo<OtherTypes&&, Types>)
|
|
|
|
|
constexpr TTuple(TTuple<OtherTypes...>&& InValue)
|
|
|
|
|
: Super(NAMESPACE_PRIVATE::OtherTupleConstructor, MoveTemp(InValue))
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == ElementSize)
|
|
|
|
|
&& (true && ... && CConstructibleFrom<Types, OtherTypes&&>)
|
|
|
|
|
&& ((ElementSize != 1) || !(CConvertibleTo<TTuple<OtherTypes...>&&, typename TElementType<0>::Type>
|
|
|
|
|
|| CConstructibleFrom<typename TElementType<0>::Type, TTuple<OtherTypes...>&&>
|
|
|
|
|
|| CSameAs<typename TElementType<0>::Type, typename TTuple<OtherTypes...>::template TElementType<0>::Type>))
|
|
|
|
|
&& (!(true && ... && CConvertibleTo<OtherTypes&&, Types>))
|
|
|
|
|
constexpr explicit TTuple(TTuple<OtherTypes...>&& InValue)
|
|
|
|
|
&& NAMESPACE_PRIVATE::TTupleConvertMove<sizeof...(Types) != 1, Types..., OtherTypes...>::Value
|
|
|
|
|
constexpr explicit (!(true && ... && CConvertibleTo<OtherTypes&&, Types>)) TTuple(TTuple<OtherTypes...>&& InValue)
|
|
|
|
|
: Super(NAMESPACE_PRIVATE::OtherTupleConstructor, MoveTemp(InValue))
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
TTuple(const TTuple&) = default;
|
|
|
|
|
TTuple(TTuple&&) = default;
|
|
|
|
|
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == ElementSize)
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == sizeof...(Types))
|
|
|
|
|
&& (true && ... && CAssignableFrom<Types&, const OtherTypes&>)
|
|
|
|
|
constexpr TTuple& operator=(const TTuple<OtherTypes...>& InValue)
|
|
|
|
|
{
|
|
|
|
@ -300,7 +341,7 @@ public:
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == ElementSize)
|
|
|
|
|
template <typename... OtherTypes> requires (sizeof...(OtherTypes) == sizeof...(Types))
|
|
|
|
|
&& (true && ... && CAssignableFrom<Types&, OtherTypes&&>)
|
|
|
|
|
constexpr TTuple& operator=(TTuple<OtherTypes...>&& InValue)
|
|
|
|
|
{
|
|
|
|
@ -311,59 +352,59 @@ public:
|
|
|
|
|
TTuple& operator=(const TTuple&) = default;
|
|
|
|
|
TTuple& operator=(TTuple&&) = default;
|
|
|
|
|
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr TElementType<I>::Type& GetValue() & { return static_cast< NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr const TElementType<I>::Type& GetValue() const & { return static_cast<const NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr volatile TElementType<I>::Type& GetValue() volatile& { return static_cast< volatile NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr const volatile TElementType<I>::Type& GetValue() const volatile& { return static_cast<const volatile NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr TElementType<I>::Type&& GetValue() && { return static_cast< NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr const TElementType<I>::Type&& GetValue() const && { return static_cast<const NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr volatile TElementType<I>::Type&& GetValue() volatile&& { return static_cast< volatile NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < ElementSize) constexpr const volatile TElementType<I>::Type&& GetValue() const volatile&& { return static_cast<const volatile NAMESPACE_PRIVATE::TTupleElement<typename TElementType<I>::Type, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() & { return static_cast< NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() const & { return static_cast<const NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() volatile& { return static_cast< volatile NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() const volatile& { return static_cast<const volatile NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>& >(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() && { return static_cast< NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() const && { return static_cast<const NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() volatile&& { return static_cast< volatile NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>&&>(*this).GetValue(); }
|
|
|
|
|
template <size_t I> requires (I < sizeof...(Types)) constexpr decltype(auto) GetValue() const volatile&& { return static_cast<const volatile NAMESPACE_PRIVATE::TTupleBasicElement<TTupleElement<I, TTuple<Types...>>, I>&&>(*this).GetValue(); }
|
|
|
|
|
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr T& GetValue() & { return static_cast< TTuple& >(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr const T& GetValue() const & { return static_cast<const TTuple& >(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr volatile T& GetValue() volatile& { return static_cast< volatile TTuple& >(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr const volatile T& GetValue() const volatile& { return static_cast<const volatile TTuple& >(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr T&& GetValue() && { return static_cast< TTuple&&>(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr const T&& GetValue() const && { return static_cast<const TTuple&&>(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr volatile T&& GetValue() volatile&& { return static_cast< volatile TTuple&&>(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> requires (TElementIndex<T>::Value != INDEX_NONE) constexpr const volatile T&& GetValue() const volatile&& { return static_cast<const volatile TTuple&&>(*this).GetValue<TElementIndex<T>::Value>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() & { return static_cast< TTuple& >(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() const & { return static_cast<const TTuple& >(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() volatile& { return static_cast< volatile TTuple& >(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() const volatile& { return static_cast<const volatile TTuple& >(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() && { return static_cast< TTuple&&>(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() const && { return static_cast<const TTuple&&>(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() volatile&& { return static_cast< volatile TTuple&&>(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
template <typename T> constexpr decltype(auto) GetValue() const volatile&& { return static_cast<const volatile TTuple&&>(*this).GetValue<TTupleIndex<T, TTuple<Types...>>>(); }
|
|
|
|
|
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) & { return Helper::Apply(Forward<F>(Func), static_cast< TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) const & { return Helper::Apply(Forward<F>(Func), static_cast<const TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) volatile& { return Helper::Apply(Forward<F>(Func), static_cast< volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) const volatile& { return Helper::Apply(Forward<F>(Func), static_cast<const volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) && { return Helper::Apply(Forward<F>(Func), static_cast< TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) const && { return Helper::Apply(Forward<F>(Func), static_cast<const TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) volatile&& { return Helper::Apply(Forward<F>(Func), static_cast< volatile TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr auto Apply(F&& Func) const volatile&& { return Helper::Apply(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) & { return Helper::Apply(Forward<F>(Func), static_cast< TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) const & { return Helper::Apply(Forward<F>(Func), static_cast<const TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) volatile& { return Helper::Apply(Forward<F>(Func), static_cast< volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) const volatile& { return Helper::Apply(Forward<F>(Func), static_cast<const volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) && { return Helper::Apply(Forward<F>(Func), static_cast< TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) const && { return Helper::Apply(Forward<F>(Func), static_cast<const TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) volatile&& { return Helper::Apply(Forward<F>(Func), static_cast< volatile TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires CInvocable<F, Types...> constexpr decltype(auto) Apply(F&& Func) const volatile&& { return Helper::Apply(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this)); }
|
|
|
|
|
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) & { return Helper::ApplyAfter(Forward<F>(Func), static_cast< TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) const & { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) volatile& { return Helper::ApplyAfter(Forward<F>(Func), static_cast< volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) const volatile& { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) && { return Helper::ApplyAfter(Forward<F>(Func), static_cast< TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) const && { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) volatile&& { return Helper::ApplyAfter(Forward<F>(Func), static_cast< volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr auto ApplyAfter(F&& Func, ArgTypes&&... Args) const volatile&& { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) & { return Helper::ApplyAfter(Forward<F>(Func), static_cast< TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) const & { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) volatile& { return Helper::ApplyAfter(Forward<F>(Func), static_cast< volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) const volatile& { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) && { return Helper::ApplyAfter(Forward<F>(Func), static_cast< TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) const && { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) volatile&& { return Helper::ApplyAfter(Forward<F>(Func), static_cast< volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, ArgTypes..., Types...> constexpr decltype(auto) ApplyAfter(F&& Func, ArgTypes&&... Args) const volatile&& { return Helper::ApplyAfter(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) & { return Helper::ApplyBefore(Forward<F>(Func), static_cast< TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) const & { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) volatile& { return Helper::ApplyBefore(Forward<F>(Func), static_cast< volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) const volatile& { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) && { return Helper::ApplyBefore(Forward<F>(Func), static_cast< TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) const && { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) volatile&& { return Helper::ApplyBefore(Forward<F>(Func), static_cast< volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr auto ApplyBefore(F&& Func, ArgTypes&&... Args) const volatile&& { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) & { return Helper::ApplyBefore(Forward<F>(Func), static_cast< TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) const & { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) volatile& { return Helper::ApplyBefore(Forward<F>(Func), static_cast< volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) const volatile& { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const volatile TTuple& >(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) && { return Helper::ApplyBefore(Forward<F>(Func), static_cast< TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) const && { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) volatile&& { return Helper::ApplyBefore(Forward<F>(Func), static_cast< volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
template <typename F, typename... ArgTypes> requires CInvocable<F, Types..., ArgTypes...> constexpr decltype(auto) ApplyBefore(F&& Func, ArgTypes&&... Args) const volatile&& { return Helper::ApplyBefore(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this), Forward<ArgTypes>(Args)...); }
|
|
|
|
|
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) & { return Helper::Transform(Forward<F>(Func), static_cast< TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) const & { return Helper::Transform(Forward<F>(Func), static_cast<const TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) volatile& { return Helper::Transform(Forward<F>(Func), static_cast< volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) const volatile& { return Helper::Transform(Forward<F>(Func), static_cast<const volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) && { return Helper::Transform(Forward<F>(Func), static_cast< TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) const && { return Helper::Transform(Forward<F>(Func), static_cast<const TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) volatile&& { return Helper::Transform(Forward<F>(Func), static_cast< volatile TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr auto Transform(F&& Func) const volatile&& { return Helper::Transform(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) & { return Helper::Transform(Forward<F>(Func), static_cast< TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) const & { return Helper::Transform(Forward<F>(Func), static_cast<const TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) volatile& { return Helper::Transform(Forward<F>(Func), static_cast< volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) const volatile& { return Helper::Transform(Forward<F>(Func), static_cast<const volatile TTuple& >(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) && { return Helper::Transform(Forward<F>(Func), static_cast< TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) const && { return Helper::Transform(Forward<F>(Func), static_cast<const TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) volatile&& { return Helper::Transform(Forward<F>(Func), static_cast< volatile TTuple&&>(*this)); }
|
|
|
|
|
template <typename F> requires (true && ... && (CInvocable<F, Types> && !CSameAs<void, TInvokeResult<F, Types>>)) constexpr decltype(auto) Transform(F&& Func) const volatile&& { return Helper::Transform(Forward<F>(Func), static_cast<const volatile TTuple&&>(*this)); }
|
|
|
|
|
|
|
|
|
|
template <typename T> requires CConstructibleFrom<T, Types...> constexpr T Construct() & { return Helper::template Construct<T>(static_cast< TTuple& >(*this)); }
|
|
|
|
|
template <typename T> requires CConstructibleFrom<T, Types...> constexpr T Construct() const & { return Helper::template Construct<T>(static_cast<const TTuple& >(*this)); }
|
|
|
|
@ -376,12 +417,20 @@ public:
|
|
|
|
|
|
|
|
|
|
constexpr size_t GetTypeHash() const requires (true && ... && CHashable<Types>)
|
|
|
|
|
{
|
|
|
|
|
return [this]<size_t... Indices>(TIndexSequence<Indices...>) -> size_t { return HashCombine(NAMESPACE_REDCRAFT::GetTypeHash(GetValue<Indices>())...); } (TMakeIndexSequence<ElementSize>());
|
|
|
|
|
return [this]<size_t... Indices>(TIndexSequence<Indices...>) -> size_t
|
|
|
|
|
{
|
|
|
|
|
return HashCombine(NAMESPACE_REDCRAFT::GetTypeHash(GetValue<Indices>())...);
|
|
|
|
|
}
|
|
|
|
|
(TMakeIndexSequence<sizeof...(Types)>());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constexpr void Swap(TTuple& InValue) requires (true && ... && (CMoveConstructible<Types>&& CSwappable<Types>))
|
|
|
|
|
{
|
|
|
|
|
[&A = *this, &B = InValue]<size_t... Indices>(TIndexSequence<Indices...>) { ((NAMESPACE_REDCRAFT::Swap(A.template GetValue<Indices>(), B.template GetValue<Indices>())), ...); } (TMakeIndexSequence<ElementSize>());
|
|
|
|
|
[&A = *this, &B = InValue]<size_t... Indices>(TIndexSequence<Indices...>)
|
|
|
|
|
{
|
|
|
|
|
((NAMESPACE_REDCRAFT::Swap(A.template GetValue<Indices>(), B.template GetValue<Indices>())), ...);
|
|
|
|
|
}
|
|
|
|
|
(TMakeIndexSequence<sizeof...(Types)>());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
@ -392,28 +441,10 @@ TTuple(Types...) -> TTuple<Types...>;
|
|
|
|
|
template <typename T, typename U>
|
|
|
|
|
using TPair = TTuple<T, U>;
|
|
|
|
|
|
|
|
|
|
NAMESPACE_PRIVATE_BEGIN
|
|
|
|
|
|
|
|
|
|
template <typename T > struct TIsTTuple : FFalse { };
|
|
|
|
|
template <typename... Types> struct TIsTTuple<TTuple<Types...>> : FTrue { };
|
|
|
|
|
|
|
|
|
|
NAMESPACE_PRIVATE_END
|
|
|
|
|
|
|
|
|
|
template <typename T> concept CTTuple = NAMESPACE_PRIVATE::TIsTTuple<T>::Value;
|
|
|
|
|
|
|
|
|
|
template <typename TupleType> requires CTTuple<TRemoveCVRef<TupleType>>
|
|
|
|
|
struct TTupleElementSize : TConstant<size_t, TRemoveCVRef<TupleType>::ElementSize> { };
|
|
|
|
|
|
|
|
|
|
template <size_t I, typename TupleType> requires CTTuple<TRemoveCVRef<TupleType>>
|
|
|
|
|
struct TTupleElementType { using Type = TCopyCVRef<TRemoveReference<TupleType>, typename TRemoveCVRef<TupleType>::template TElementType<I>::Type>; };
|
|
|
|
|
|
|
|
|
|
template <typename T, typename TupleType> requires CTTuple<TRemoveCVRef<TupleType>>
|
|
|
|
|
struct TTupleElementIndex : TupleType::template TElementIndex<T> { };
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
|
constexpr TTuple<typename TUnwrapRefDecay<Types>::Type...> MakeTuple(Types&&... Args)
|
|
|
|
|
constexpr TTuple<TUnwrapRefDecay<Types>...> MakeTuple(Types&&... Args)
|
|
|
|
|
{
|
|
|
|
|
return TTuple<typename TUnwrapRefDecay<Types>::Type...>(Forward<Types>(Args)...);
|
|
|
|
|
return TTuple<TUnwrapRefDecay<Types>...>(Forward<Types>(Args)...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Types>
|
|
|
|
@ -476,7 +507,7 @@ template <size_t... ForwardIndices, size_t... TTupleIndices>
|
|
|
|
|
struct TTupleCatForward<TIndexSequence<ForwardIndices...>, TIndexSequence<TTupleIndices...>>
|
|
|
|
|
{
|
|
|
|
|
template <typename ForwardType, typename TTupleType>
|
|
|
|
|
static constexpr auto F(ForwardType&& ForwardTuple, TTupleType&& InValue)
|
|
|
|
|
static constexpr decltype(auto) F(ForwardType&& ForwardTuple, TTupleType&& InValue)
|
|
|
|
|
{
|
|
|
|
|
return ForwardAsTuple(Forward<ForwardType>(ForwardTuple).template GetValue<ForwardIndices>()..., Forward<TTupleType>(InValue).template GetValue<TTupleIndices>()...);
|
|
|
|
|
}
|
|
|
|
@ -486,15 +517,18 @@ template <typename R>
|
|
|
|
|
struct TTupleCatImpl
|
|
|
|
|
{
|
|
|
|
|
template <typename ForwardType, typename TTupleType, typename... OtherTTupleTypes>
|
|
|
|
|
static constexpr auto F(ForwardType&& ForwardTuple, TTupleType&& InValue, OtherTTupleTypes&&... OtherValue)
|
|
|
|
|
static constexpr decltype(auto) F(ForwardType&& ForwardTuple, TTupleType&& InValue, OtherTTupleTypes&&... OtherValue)
|
|
|
|
|
{
|
|
|
|
|
return F(TTupleCatForward<TMakeIndexSequence<TTupleElementSize<ForwardType>::Value>, TMakeIndexSequence<TTupleElementSize<TTupleType>::Value>>::F(Forward<ForwardType>(ForwardTuple), Forward<TTupleType>(InValue)), Forward<OtherTTupleTypes>(OtherValue)...);
|
|
|
|
|
return F(TTupleCatForward<
|
|
|
|
|
TMakeIndexSequence<TTupleArity<TRemoveReference<ForwardType>>>,
|
|
|
|
|
TMakeIndexSequence<TTupleArity<TRemoveReference<TTupleType>>>>
|
|
|
|
|
::F(Forward<ForwardType>(ForwardTuple), Forward<TTupleType>(InValue)), Forward<OtherTTupleTypes>(OtherValue)...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename ForwardType>
|
|
|
|
|
static constexpr auto F(ForwardType&& ForwardTuple)
|
|
|
|
|
static constexpr decltype(auto) F(ForwardType&& ForwardTuple)
|
|
|
|
|
{
|
|
|
|
|
return TTupleCatMake<R, TMakeIndexSequence<TTupleElementSize<ForwardType>::Value>>::F(Forward<ForwardType>(ForwardTuple));
|
|
|
|
|
return TTupleCatMake<R, TMakeIndexSequence<TTupleArity<ForwardType>>>::F(Forward<ForwardType>(ForwardTuple));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -546,13 +580,13 @@ struct TTupleVisitImpl<TIndexSequence<>>
|
|
|
|
|
|
|
|
|
|
NAMESPACE_PRIVATE_END
|
|
|
|
|
|
|
|
|
|
template <typename... TTupleTypes> requires (true && ... && (CTTuple<TRemoveCVRef<TTupleTypes>>))
|
|
|
|
|
struct TTupleCatResult { using Type = typename NAMESPACE_PRIVATE::TTupleCatResultImpl<TRemoveReference<TTupleTypes>..., NAMESPACE_PRIVATE::FTupleEndFlag>::Type; };
|
|
|
|
|
template <typename... TTupleTypes> requires (true && ... && CTTuple<TRemoveCVRef<TTupleTypes>>)
|
|
|
|
|
using TTupleCatResult = typename NAMESPACE_PRIVATE::TTupleCatResultImpl<TRemoveReference<TTupleTypes>..., NAMESPACE_PRIVATE::FTupleEndFlag>::Type;;
|
|
|
|
|
|
|
|
|
|
template <typename... TTupleTypes> requires (true && ... && (CTTuple<TRemoveCVRef<TTupleTypes>>))
|
|
|
|
|
constexpr auto TupleCat(TTupleTypes&&... Args)
|
|
|
|
|
template <typename... TTupleTypes> requires (true && ... && CTTuple<TRemoveCVRef<TTupleTypes>>)
|
|
|
|
|
constexpr decltype(auto) TupleCat(TTupleTypes&&... Args)
|
|
|
|
|
{
|
|
|
|
|
using R = typename TTupleCatResult<TTupleTypes...>::Type;
|
|
|
|
|
using R = TTupleCatResult<TTupleTypes...>;
|
|
|
|
|
if constexpr (sizeof...(Args) == 0) return R();
|
|
|
|
|
else return NAMESPACE_PRIVATE::TTupleCatImpl<R>::F(Forward<TTupleTypes>(Args)...);
|
|
|
|
|
}
|
|
|
|
@ -565,9 +599,9 @@ constexpr bool operator==(const TTuple<LHSTypes...>& LHS, const TTuple<RHSTypes.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... LHSTypes, typename... RHSTypes> requires ((sizeof...(LHSTypes) == sizeof...(RHSTypes)) && (true && ... && (CSynthThreeWayComparable<LHSTypes, RHSTypes>)))
|
|
|
|
|
constexpr typename TCommonComparisonCategory<typename TSynthThreeWayResult<LHSTypes, RHSTypes>::Type...>::Type operator<=>(const TTuple<LHSTypes...>& LHS, const TTuple<RHSTypes...>& RHS)
|
|
|
|
|
constexpr TCommonComparisonCategory<TSynthThreeWayResult<LHSTypes, RHSTypes>...> operator<=>(const TTuple<LHSTypes...>& LHS, const TTuple<RHSTypes...>& RHS)
|
|
|
|
|
{
|
|
|
|
|
using R = typename TCommonComparisonCategory<typename TSynthThreeWayResult<LHSTypes, RHSTypes>::Type...>::Type;
|
|
|
|
|
using R = TCommonComparisonCategory<TSynthThreeWayResult<LHSTypes, RHSTypes>...>;
|
|
|
|
|
return NAMESPACE_PRIVATE::TTupleThreeWay<R, TMakeIndexSequence<sizeof...(LHSTypes)>>::F(LHS, RHS);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -577,7 +611,8 @@ constexpr void VisitTuple(F&& Func) { }
|
|
|
|
|
template <typename F, typename FirstTupleType, typename... TupleTypes>
|
|
|
|
|
constexpr void VisitTuple(F&& Func, FirstTupleType&& FirstTuple, TupleTypes&&... Tuples)
|
|
|
|
|
{
|
|
|
|
|
NAMESPACE_PRIVATE::TTupleVisitImpl<TMakeIndexSequence<TTupleElementSize<FirstTupleType>::Value>>::F(Forward<F>(Func), Forward<FirstTupleType>(FirstTuple), Forward<TupleTypes>(Tuples)...);
|
|
|
|
|
NAMESPACE_PRIVATE::TTupleVisitImpl<TMakeIndexSequence<TTupleArity<TRemoveReference<FirstTupleType>>>>
|
|
|
|
|
::F(Forward<F>(Func), Forward<FirstTupleType>(FirstTuple), Forward<TupleTypes>(Tuples)...);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename... Ts, typename... Us> requires requires { typename TTuple<TCommonType<Ts, Us>...>; }
|
|
|
|
@ -600,8 +635,8 @@ NAMESPACE_REDCRAFT_END
|
|
|
|
|
NAMESPACE_STD_BEGIN
|
|
|
|
|
|
|
|
|
|
// Support structure binding, should not be directly used
|
|
|
|
|
template <typename... Types> struct tuple_size<NAMESPACE_REDCRAFT::TTuple<Types...>> : integral_constant<size_t, NAMESPACE_REDCRAFT::TTupleElementSize<NAMESPACE_REDCRAFT::TTuple<Types...>>::Value> { };
|
|
|
|
|
template <size_t I, typename... Types> struct tuple_element<I, NAMESPACE_REDCRAFT::TTuple<Types...>> { using type = typename NAMESPACE_REDCRAFT::TTupleElementType<I, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type; };
|
|
|
|
|
template <typename... Types> struct tuple_size<NAMESPACE_REDCRAFT::TTuple<Types...>> : integral_constant<size_t, NAMESPACE_REDCRAFT::TTupleArity<NAMESPACE_REDCRAFT::TTuple<Types...>>> { };
|
|
|
|
|
template <size_t I, typename... Types> struct tuple_element<I, NAMESPACE_REDCRAFT::TTuple<Types...>> { using type = NAMESPACE_REDCRAFT::TTupleElement<I, NAMESPACE_REDCRAFT::TTuple<Types...>>; };
|
|
|
|
|
|
|
|
|
|
NAMESPACE_STD_END
|
|
|
|
|
|
|
|
|
@ -610,14 +645,14 @@ NAMESPACE_MODULE_BEGIN(Redcraft)
|
|
|
|
|
NAMESPACE_MODULE_BEGIN(Utility)
|
|
|
|
|
|
|
|
|
|
// Support structure binding, should not be directly used
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& get( NAMESPACE_REDCRAFT::TTuple<Types...>& InValue) { return static_cast< typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& >(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr const typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& get(const NAMESPACE_REDCRAFT::TTuple<Types...>& InValue) { return static_cast<const typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& >(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& get( volatile NAMESPACE_REDCRAFT::TTuple<Types...>& InValue) { return static_cast< volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& >(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr const volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& get(const volatile NAMESPACE_REDCRAFT::TTuple<Types...>& InValue) { return static_cast<const volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type& >(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&& get( NAMESPACE_REDCRAFT::TTuple<Types...>&& InValue) { return static_cast< typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&&>(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr const typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&& get(const NAMESPACE_REDCRAFT::TTuple<Types...>&& InValue) { return static_cast<const typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&&>(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&& get( volatile NAMESPACE_REDCRAFT::TTuple<Types...>&& InValue) { return static_cast< volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&&>(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr const volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&& get(const volatile NAMESPACE_REDCRAFT::TTuple<Types...>&& InValue) { return static_cast<const volatile typename TTupleElementType<Index, NAMESPACE_REDCRAFT::TTuple<Types...>>::Type&&>(InValue.template GetValue<Index>()); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get( TTuple<Types...>& InValue) { return static_cast< TTuple<Types...>& >(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get(const TTuple<Types...>& InValue) { return static_cast<const TTuple<Types...>& >(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get( volatile TTuple<Types...>& InValue) { return static_cast< volatile TTuple<Types...>& >(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get(const volatile TTuple<Types...>& InValue) { return static_cast<const volatile TTuple<Types...>& >(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get( TTuple<Types...>&& InValue) { return static_cast< TTuple<Types...>&&>(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get(const TTuple<Types...>&& InValue) { return static_cast<const TTuple<Types...>&&>(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get( volatile TTuple<Types...>&& InValue) { return static_cast< volatile TTuple<Types...>&&>(InValue).template GetValue<Index>(); }
|
|
|
|
|
template <size_t Index, typename ...Types> constexpr decltype(auto) get(const volatile TTuple<Types...>&& InValue) { return static_cast<const volatile TTuple<Types...>&&>(InValue).template GetValue<Index>(); }
|
|
|
|
|
|
|
|
|
|
NAMESPACE_MODULE_END(Utility)
|
|
|
|
|
NAMESPACE_MODULE_END(Redcraft)
|
|
|
|
|