16#include "CoreMinimal.h"
32 template <
typename ReturnIn,
typename... Args>
50 using Arg =
typename TTupleElement<I, Arguments>::Type;
53 using ArgDecay =
typename TTupleElement<I, ArgumentsDecay>::Type;
76 template <CFunctorObject T>
87 template <
typename ClassIn,
typename ReturnIn,
typename... Args>
99 template <
typename ClassIn,
typename ReturnIn,
typename... Args>
111 template <
typename ReturnIn,
typename... Args>
114 static constexpr bool IsFunction =
true;
115 static constexpr bool IsPointer =
true;
116 static constexpr bool IsFunctor =
false;
117 static constexpr bool IsMember =
false;
118 static constexpr bool IsConst =
false;
122 template <
typename ReturnIn,
typename... Args>
133 template <
typename T>
137 template <
typename T>
141 template <
typename T,
int I>
145 template <
typename T,
int I>
149 template <
typename T>
153 template <
typename T>
157 template <
typename T>
161 template <
typename T>
164 template <
typename T>
168 template <CFunction_IsMember T>
172 template <
typename T>
176 template <
typename T>
180 template <
typename T>
183 template <
typename Class,
typename Function>
185 && (CDerivedFrom<Class, TFunction_Class<Function>> || CSameAs<Class, TFunction_Class<Function>>)
190 template <
typename Return,
typename Tuple,
size_t... Indices>
193 template <
typename Return,
typename Tuple>
196 template <
size_t... Indices>
199 using Type = std::remove_pointer_t<
decltype(
200 Compose(std::make_index_sequence<TTupleArity<Tuple>::Value>{})
206 template <
typename Return,
typename Tuple>
210 template <
typename Return,
typename DstFunction>
214 template <
typename Return,
typename DstFunction>
218 template <
typename SrcFunction,
typename DstFunction>
222 template <
typename SrcFunction,
typename DstFunction>
227 template<
typename Function,
size_t... Sequence>
231 std::index_sequence<Sequence...>&&
234 return function(arguments.template Get<Sequence>()...);
237 template<
typename Object,
typename Function,
size_t... Sequence>
242 std::index_sequence<Sequence...>&&
245 return (object->*function)(arguments.template Get<Sequence>()...);
254 template<
typename Function>
258 Forward<Function>(function), arguments,
268 template<CFunctionPtr Function, CHasFunction<Function> Object>
273 Forward<Function>(function), arguments,
283 template <auto FuncPtr>
296 template <auto FuncPtr, CFunctionPtr Function = decltype(FuncPtr)>
307 template <
typename... Args>
309 : Storage(Forward<Args>(args)...)
312 template <CConvertibleToDecayed<FirstArg> FirstArgRef>
315 auto args = arg >> Storage;
This header exists because STL headers in Android doesn't define STL concepts (other than same_as whi...
A concept accepting any function like entity (function pointer or functor object)
A concept accepting function pointer types.
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...
TFunction_Return< Function > InvokeWithTuple_Impl(Function &&function, TFunction_Arguments< Function > const &arguments, std::index_sequence< Sequence... > &&)
Return(typename TTupleElement< Indices, Tuple >::Type...) TFunctionFromTupleIndices
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.
TFunction_Return< Function > InvokeWithTuple(Function &&function, TFunction_Arguments< Function > const &arguments)
A clone of std::apply for Unreal tuples which also supports function pointers. TL;DR: It calls a func...
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.
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.
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