16#include "CoreMinimal.h"
31 template <
typename ReturnIn,
typename... Args>
93 template <CFunctorObject T>
104 template <
typename ClassIn,
typename ReturnIn,
typename... Args>
116 template <
typename ClassIn,
typename ReturnIn,
typename... Args>
128 template <
typename ReturnIn,
typename... Args>
131 static constexpr bool IsFunction =
true;
132 static constexpr bool IsPointer =
true;
133 static constexpr bool IsFunctor =
false;
134 static constexpr bool IsMember =
false;
135 static constexpr bool IsConst =
false;
139 template <
typename ReturnIn,
typename... Args>
150 template <
typename T>
154 template <
typename T>
158 template <
typename T>
162 template <
typename T>
166 template <
typename T>
170 template <
typename T>
174 template <
typename T>
178 template <
typename T>
182 template <
typename T,
int I>
186 template <
typename T,
int I>
190 template <
typename T>
194 template <
typename T>
198 template <
typename T>
202 template <
typename T>
205 template <
typename T>
209 template <CFunction_IsMember T>
213 template <
typename T>
217 template <
typename T>
221 template <
typename T>
224 template <
typename Class,
typename Function>
226 && (CDerivedFrom<Class, TFunction_Class<Function>> || CSameAs<Class, TFunction_Class<Function>>)
231 template <
typename Return,
typename>
237 template <
typename Return,
typename... Types>
245 template <
typename Return,
typename TypeList>
249 template <
typename Return,
typename DstFunction>
253 template <
typename Return,
typename DstFunction>
257 template <
typename SrcFunction,
typename DstFunction>
261 template <
typename SrcFunction,
typename DstFunction>
266 template <
typename Function, CTuple Tuple,
size_t... Sequence>
270 std::index_sequence<Sequence...>&&
272 return function(GetItem<Sequence>(arguments)...);
275 template <
typename Object,
typename Function, CTuple Tuple,
size_t... Sequence>
280 std::index_sequence<Sequence...>&&
282 return (object->*function)(GetItem<Sequence>(arguments)...);
291 template <
typename Tuple,
typename Function>
295 CConvertibleTo<Tuple, typename TFunctionTraits<std::decay_t<Function>>::ArgumentsTuple>
296 || CConvertibleTo<Tuple, typename TFunctionTraits<std::decay_t<Function>>::ArgumentsStd>
297 || CConvertibleTo<Tuple, typename TFunctionTraits<std::decay_t<Function>>::ArgumentsRangeV3>
307 template <
typename Function, CTupleCompatibleWithFunction<Function> Tuple>
311 FWD(function),
FWD(arguments),
324 CFunctionPtr Function,
325 CHasFunction<Function> Object,
326 CTupleCompatibleWithFunction<Function> Tuple
332 FWD(function),
FWD(arguments),
338 template <
typename F,
typename Return>
341 && CConvertibleToDecayed<TFunction_ReturnDecay<F>, Return>
345 template <
typename F,
typename Return>
348 && CConvertibleTo<TFunction_Return<F>, Return>
352 template <
typename F,
typename With>
356 && CTypesConvertibleToDecayed<
363 template <
typename F,
typename With>
367 && CTypesConvertibleTo<
378 template <
typename F,
typename With>
391 template <
typename F,
typename With>
400 template <
typename Function,
size_t Count>
406 template <
typename Function>
410 template <
typename F>
418 template <auto FuncPtr>
431 template <auto FuncPtr, CFunctionPtr Function = decltype(FuncPtr)>
442 template <
typename... Args>
444 : Storage(
FWD(args)...)
447 template <CConvertibleToDecayed<FirstArg> FirstArgRef>
450 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.
Accept only functions which has given number of arguments, whatever type they may be.
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...
Accept only functions which has 0 arguments.
Is given tuple type compatible with the arguments of the given function?
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 > >::ArgumentsStd TFunction_ArgumentsStd
Shorthand for getting a list representing the function arguments.
typename TFunctionTraits< std::decay_t< T > >::ArgumentsTupleDecay TFunction_ArgumentsTupleDecay
Shorthand for getting a list representing the decayed function arguments.
typename Detail::TFunctionFromTypes_Struct< Return, std::decay_t< TypeList > >::Type TFunctionFromTypes
Compose a function type from a tuple of arguments and a return type.
typename TFunctionTraits< std::decay_t< T > >::ArgumentsStdDecay TFunction_ArgumentsStdDecay
Shorthand for getting a list representing the decayed function arguments.
TFunctionFromTypes< Return, TFunction_Arguments< DstFunction > > TSetReturn
Override the return type of an input function signature.
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 > >::ArgumentsRangeV3 TFunction_ArgumentsRangeV3
Shorthand for getting a list representing the function arguments.
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 list 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.
TSetReturnDecay< TFunction_ReturnDecay< SrcFunction >, DstFunction > TCopyReturnDecay
Copy the return type from source function signature to the destination one, and discard its qualifier...
TFunctionFromTypes< std::decay_t< Return >, TFunction_Arguments< DstFunction > > TSetReturnDecay
Override the return type of an input function signature, and discard its qualifiers.
typename TFunctionTraits< std::decay_t< T > >::ArgumentsRangeV3Decay TFunction_ArgumentsRangeV3Decay
Shorthand for getting a list representing the decayed function arguments.
typename TFunctionTraits< std::decay_t< T > >::Arguments TFunction_Arguments
Shorthand for getting a list representing the function arguments.
typename TFunctionTraits< std::decay_t< T > >::ArgumentsTuple TFunction_ArgumentsTuple
Shorthand for getting a list representing the function arguments.
T::template Get< I > TTypes_Get
Templating utilities for manipulating TTuples.
typename TTupleSkip_Struct< Count, Tuple >::Type TTupleSkip
Skip the first Count elements of the input tuple.
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)
TTupleSkip< 1, TFunction_ArgumentsTuple< 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
This template is used to store pack of types in other templates, or to allow parameter pack inference...