16#include "CoreMinimal.h"
31 template <
typename ReturnIn,
typename... Args>
87 template <CFunctorObject T>
98 template <
typename ClassIn,
typename ReturnIn,
typename... Args>
110 template <
typename ClassIn,
typename ReturnIn,
typename... Args>
122 template <
typename ReturnIn,
typename... Args>
125 static constexpr bool IsFunction =
true;
126 static constexpr bool IsPointer =
true;
127 static constexpr bool IsFunctor =
false;
128 static constexpr bool IsMember =
false;
129 static constexpr bool IsConst =
false;
133 template <
typename ReturnIn,
typename... Args>
144 template <
typename T>
148 template <
typename T>
152 template <
typename T,
int I>
156 template <
typename T,
int I>
160 template <
typename T>
164 template <
typename T>
168 template <
typename T>
172 template <
typename T>
175 template <
typename T>
179 template <CFunction_IsMember T>
183 template <
typename T>
187 template <
typename T>
191 template <
typename T>
194 template <
typename Class,
typename Function>
196 && (CDerivedFrom<Class, TFunction_Class<Function>> || CSameAs<Class, TFunction_Class<Function>>)
201 template <
typename Return,
typename Tuple,
size_t... Indices>
204 template <
typename Return,
typename Tuple>
207 template <
size_t... Indices>
210 using Type = std::remove_pointer_t<
decltype(
211 Compose(std::make_index_sequence<TTupleArity<Tuple>::Value>{})
217 template <
typename Return,
typename Tuple>
221 template <
typename Return,
typename DstFunction>
225 template <
typename Return,
typename DstFunction>
229 template <
typename SrcFunction,
typename DstFunction>
233 template <
typename SrcFunction,
typename DstFunction>
238 template <
typename Function, CTuple Tuple,
size_t... Sequence>
242 std::index_sequence<Sequence...>&&
244 return function(GetItem<Sequence>(arguments)...);
247 template <
typename Object,
typename Function, CTuple Tuple,
size_t... Sequence>
252 std::index_sequence<Sequence...>&&
254 return (object->*function)(GetItem<Sequence>(arguments)...);
263 template <
typename Tuple,
typename Function>
267 CConvertibleTo<Tuple, typename TFunctionTraits<std::decay_t<Function>>::Arguments>
268 || CConvertibleTo<Tuple, typename TFunctionTraits<std::decay_t<Function>>::ArgumentsStd>
269 || CConvertibleTo<Tuple, typename TFunctionTraits<std::decay_t<Function>>::ArgumentsRangeV3>
279 template <
typename Function, CTupleCompatibleWithFunction<Function> Tuple>
283 FWD(function),
FWD(arguments),
296 CFunctionPtr Function,
297 CHasFunction<Function> Object,
298 CTupleCompatibleWithFunction<Function> Tuple
304 FWD(function),
FWD(arguments),
310 template <
typename F,
typename Return>
313 && CConvertibleToDecayed<TFunction_ReturnDecay<F>, Return>
317 template <
typename F,
typename Return>
320 && CConvertibleTo<TFunction_Return<F>, Return>
324 template <
typename F,
typename With>
328 && CConvertibleToDecayed<
335 template <
typename F,
typename With>
350 template <
typename F,
typename With>
363 template <
typename F,
typename With>
372 template <
typename F>
380 template <auto FuncPtr>
393 template <auto FuncPtr, CFunctionPtr Function = decltype(FuncPtr)>
404 template <
typename... Args>
406 : Storage(
FWD(args)...)
409 template <CConvertibleToDecayed<FirstArg> FirstArgRef>
412 auto args = arg >> Storage;
This header exists because STL headers in Android doesn't define STL concepts (other than same_as whi...
#define FWD(...)
Shorten forwarding expression with this macro so one may not need to specify explicit type.
Concept constraining a function type to another one which arguments and return types are compatible,...
Concept matching function types with compatible set of arguments, disregarding CV-ref qualifiers.
Concept matching function types with compatible set of arguments, preserving CV-ref qualifiers.
Concept matching the return of a type with compatible return types, disregarding CV-ref qualifiers.
Concept matching the return of a type with compatible return types, preserving CV-ref qualifiers.
Concept constraining a function type to another one which arguments and return types are compatible,...
A concept accepting any function like entity (function pointer or functor object)
A concept accepting function pointer types.
Concept matching function types returning void.
Shorthand for getting the constness of a member function.
Concept constraining input T to a lambda function or a functor object.
Tests if a provided class member function pointer instance (not type!) is indeed an instance member m...
Is given tuple type compatible with the arguments of the given function?
Return(typename TTupleElement< Indices, Tuple >::Type...) TFunctionFromTupleIndices
TFunction_Return< Function > InvokeWithTuple_Impl(Function &&function, Tuple &&arguments, std::index_sequence< Sequence... > &&)
typename TFunctionTraits< std::decay_t< T > >::template Arg< I > TFunction_Arg
Shorthand for getting a type of a function argument at given position I.
typename TFunctionTraits< std::decay_t< T > >::Return TFunction_Return
Shorthand for getting a function return type.
typename TFunctionTraits< std::decay_t< T > >::Return TFunction_ReturnDecay
Shorthand for getting a function return type discarding qualifiers.
constexpr size_t TFunction_ArgCount
Shorthand for getting a function argument count.
typename TFunctionTraits< std::decay_t< T > >::Class TFunction_Class
Shorthand for getting the class of a member function.
typename TFunctionTraits< std::decay_t< T > >::ArgumentsDecay TFunction_ArgumentsDecay
Shorthand for getting a tuple representing the decayed function arguments.
typename TFunctionTraits< std::decay_t< T > >::Signature TFunction_Signature
Shorthand for getting a pur function signature.
typename TFunctionTraits< std::decay_t< T > >::template ArgDecay< I > TFunction_ArgDecay
Shorthand for getting a decayed type of a function argument at given position I.
TFunction_Return< Function > InvokeWithTuple(Function &&function, Tuple &&arguments)
A clone of std::apply for Unreal, STL and RangeV3 tuples which also supports function pointers.
TSetReturn< TFunction_Return< SrcFunction >, DstFunction > TCopyReturn
Copy the return type from source function signature to the destination one.
TFunctionFromTuple< std::decay_t< Return >, TFunction_Arguments< DstFunction > > TSetReturnDecay
Override the return type of an input function signature, and discard its qualifiers.
TFunctionFromTuple< Return, TFunction_Arguments< DstFunction > > TSetReturn
Override the return type of an input function signature.
TSetReturnDecay< TFunction_ReturnDecay< SrcFunction >, DstFunction > TCopyReturnDecay
Copy the return type from source function signature to the destination one, and discard its qualifier...
typename Detail::TFunctionFromTuple_Struct< Return, std::decay_t< Tuple > >::Type TFunctionFromTuple
Compose a function type from a tuple of arguments and a return type.
typename TFunctionTraits< std::decay_t< T > >::Arguments TFunction_Arguments
Shorthand for getting a tuple representing the function arguments.
Templating utilities for manipulating TTuples.
typename TSkip_Struct< Count, Tuple >::Type TSkip
Skip the first Count elements of the input tuple.
typename TTypeAt_Struct< I, T >::Type TTypeAt
static consteval TFunctionFromTupleIndices< Return, Tuple, Indices... > * Compose(std::index_sequence< Indices... > &&)
std::remove_pointer_t< decltype( Compose(std::make_index_sequence< TTupleArity< Tuple >::Value >{}))> Type
Defers a set of arguments for a function call later with its first argument. This is useful for devel...
TFunction_Return< Function > Return
Return operator()(FirstArgRef &&arg)
TSkip< 1, TFunction_Arguments< Function > > ExtraArgs
TFunction_Arg< Function, 0 > FirstArg
TDeferFunctionArguments(Args... args)
Get signature information about any function declaring type (function pointer or functor structs incl...
static constexpr bool IsMember
static constexpr bool IsFunctor
static constexpr bool IsConst
static constexpr size_t ArgumentCount
static constexpr bool IsFunction
static constexpr bool IsPointer