UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Function.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "AutoRTFM.h"
10#include "HAL/UnrealMemory.h"
11#include "Templates/FunctionFwd.h" // IWYU pragma: export
13#include "Templates/Invoke.h"
15#include "Templates/Requires.h"
17#include <new> // IWYU pragma: export
18#include <type_traits>
19
20// Disable visualization hack for shipping or test builds.
21#if defined(UE_ENABLE_TFUNCTIONREF_VISUALIZATION) && UE_ENABLE_TFUNCTIONREF_VISUALIZATION
22 COMPILE_WARNING("TFunction visualization has been removed - please undefine UE_ENABLE_TFUNCTIONREF_VISUALIZATION.")
23#endif
24
25#if !defined(NUM_TFUNCTION_INLINE_BYTES) || NUM_TFUNCTION_INLINE_BYTES == 0
26 #define TFUNCTION_USES_INLINE_STORAGE 0
27#else
28 #define TFUNCTION_USES_INLINE_STORAGE 1
29 #define TFUNCTION_INLINE_SIZE NUM_TFUNCTION_INLINE_BYTES
30 #define TFUNCTION_INLINE_ALIGNMENT 16
31#endif
32
37{
38 template <typename T, bool bUnique, bool bOnHeap>
39 struct TFunction_OwnedObject;
40
41 struct FFunctionStorage;
42
43 template <bool bUnique>
44 struct TFunctionStorage;
45
50 {
54 virtual void* CloneToEmptyStorage(FFunctionStorage* Storage) const = 0;
55
59 virtual void* GetAddress() = 0;
60
64 virtual void Destroy() = 0;
65
69 virtual ~IFunction_OwnedObject() = default;
70 };
71
72 template <typename T, bool bUnique, bool bOnHeap>
74 {
75 template <typename ArgType>
77 : Obj(Forward<ArgType>(Arg))
78 {
79 }
80
81 virtual void* GetAddress() override
82 {
83 return &Obj;
84 }
85
86 void* CloneToEmptyStorage(FFunctionStorage* UntypedStorage) const override;
87
88 virtual void Destroy() override
89 {
90 if constexpr (bOnHeap)
91 {
92 void* This = this;
94 FMemory::Free(This);
95 }
96 else
97 {
99 }
100 }
101
103 {
104 // It is not necessary to define this destructor but MSVC will
105 // erroneously issue warning C5046 without it.
106 }
107
109 };
110
111 template <typename T>
112 FORCEINLINE bool IsBound(const T& Func)
113 {
114 if constexpr (std::is_pointer_v<T> || std::is_member_pointer_v<T> || TIsTFunction<T>::Value)
115 {
116 // Function pointers, data member pointers, member function pointers and TFunctions
117 // can all be null/unbound, so test them using their boolean state.
118 return !!Func;
119 }
120 else
121 {
122 // We can't tell if any other generic callable can be invoked, so just assume they can be.
123 return true;
124 }
125 }
126
128 {
129 constexpr static bool bCanBeNull = true;
130
132 : HeapAllocation(nullptr)
133 {
134 }
135
137 : HeapAllocation(Other.HeapAllocation)
138 {
139 Other.HeapAllocation = nullptr;
140 #if TFUNCTION_USES_INLINE_STORAGE
141 FMemory::Memcpy(&InlineAllocation, &Other.InlineAllocation, sizeof(InlineAllocation));
142 #endif
143 }
144
148
150 {
151 Other.GetBoundObject()->CloneToEmptyStorage(this);
152 }
153
155 {
156 IFunction_OwnedObject* Result = (IFunction_OwnedObject*)HeapAllocation;
157 #if TFUNCTION_USES_INLINE_STORAGE
158 if (!Result)
159 {
160 Result = (IFunction_OwnedObject*)&InlineAllocation;
161 }
162 #endif
163
164 return Result;
165 }
166
170 void* GetPtr() const
171 {
172 #if TFUNCTION_USES_INLINE_STORAGE
173 IFunction_OwnedObject* Owned = (IFunction_OwnedObject*)HeapAllocation;
174 if (!Owned)
175 {
176 Owned = (IFunction_OwnedObject*)&InlineAllocation;
177 }
178
179 return Owned->GetAddress();
180 #else
181 return ((IFunction_OwnedObject*)HeapAllocation)->GetAddress();
182 #endif
183 }
184
188 void Unbind()
189 {
190 IFunction_OwnedObject* Owned = GetBoundObject();
191 Owned->Destroy();
192 }
193
194 #if TFUNCTION_USES_INLINE_STORAGE
195 // Inline storage for an owned object
196 alignas(TFUNCTION_INLINE_ALIGNMENT) uint8 InlineAllocation[TFUNCTION_INLINE_SIZE];
197 #endif
198
200 };
201
202 template <bool bUnique>
204 {
205 TFunctionStorage() = default;
206
211
212 template <typename FunctorType>
213 std::decay_t<FunctorType>* Bind(FunctorType&& InFunc)
214 {
215 using DecayedFunctorType = std::decay_t<FunctorType>;
216
217 if (!IsBound(InFunc))
218 {
219 return nullptr;
220 }
221
222#if TFUNCTION_USES_INLINE_STORAGE
224#else
225 constexpr bool bOnHeap = true;
226#endif
227
229
230 void* NewAlloc;
231#if TFUNCTION_USES_INLINE_STORAGE
232 if constexpr (!bOnHeap)
233 {
234 NewAlloc = &InlineAllocation;
235 }
236 else
237#endif
238 {
239 NewAlloc = FMemory::Malloc(sizeof(OwnedType), alignof(OwnedType));
240 HeapAllocation = NewAlloc;
241 }
242
245 return &NewOwned->Obj;
246 }
247 };
248
249 template <typename T, bool bUnique, bool bOnHeap>
251 {
252 if constexpr (bUnique)
253 {
254 // Should never get here - copy functions are deleted for TUniqueFunction
255 check(false);
256 return nullptr;
257 }
258 else
259 {
261
262 void* NewAlloc;
263#if TFUNCTION_USES_INLINE_STORAGE
264 if constexpr (!bOnHeap)
265 {
266 NewAlloc = &Storage.InlineAllocation;
267 }
268 else
269#endif
270 {
271 NewAlloc = FMemory::Malloc(sizeof(TFunction_OwnedObject), alignof(TFunction_OwnedObject));
272 Storage.HeapAllocation = NewAlloc;
274 }
275
276 auto* NewOwned = ::new (NewAlloc) TFunction_OwnedObject(this->Obj);
277
278 return &NewOwned->Obj;
279 }
280 }
281
285 template <typename Functor, typename Ret, typename... ParamTypes>
287 {
288 static Ret Call(void* Obj, ParamTypes&... Params)
289 {
290 if constexpr (std::is_void_v<Ret>)
291 {
292 ::Invoke(*(Functor*)Obj, Forward<ParamTypes>(Params)...);
293 }
294 else
295 {
296 return ::Invoke(*(Functor*)Obj, Forward<ParamTypes>(Params)...);
297 }
298 }
299 };
300
301#if DO_CHECK
302 // Move all of the assert code out of line.
303 // This takes a void* to avoid multiple template instantiations - the caller should
304 // explicitly cast the Callable function pointer to void* to call this function.
305 CORE_API void CheckCallable(void* Callable);
306#endif
307
311 template <typename StorageType, typename FuncType>
313
314 template <typename StorageType, typename Ret, typename... ParamTypes>
315 struct AUTORTFM_INFER TFunctionRefBase<StorageType, Ret (ParamTypes...)>
316 {
317 template <typename OtherStorageType, typename OtherFuncType>
318 friend struct TFunctionRefBase;
319
320 TFunctionRefBase() = default;
321
323 : Callable(Other.Callable)
324 , Storage (MoveTemp(Other.Storage))
325 {
326 static_assert(StorageType::bCanBeNull, "Unable to move non-nullable storage");
327
328 if (Callable)
329 {
330 Other.Callable = nullptr;
331 }
332 }
333
334 template <typename OtherStorage>
336 : Callable(Other.Callable)
337 , Storage (MoveTemp(Other.Storage))
338 {
339 static_assert(OtherStorage::bCanBeNull, "Unable to move from non-nullable storage");
340 static_assert(StorageType::bCanBeNull, "Unable to move into non-nullable storage");
341
342 if (Callable)
343 {
344 Other.Callable = nullptr;
345 }
346 }
347
348 template <typename OtherStorage>
350 : Callable(Other.Callable)
351 {
352 if constexpr (OtherStorage::bCanBeNull)
353 {
354 static_assert(StorageType::bCanBeNull, "Unable to copy from nullable storage into non-nullable storage");
355
356 if (!Callable)
357 {
358 return;
359 }
360 }
361
362 Storage.BindCopy(Other.Storage);
363 }
364
366 : Callable(Other.Callable)
367 {
368 if constexpr (StorageType::bCanBeNull)
369 {
370 if (!Callable)
371 {
372 return;
373 }
374 }
375
376 Storage.BindCopy(Other.Storage);
377 }
378
379 template <UE::CNotCVRefTo<TFunctionRefBase> FunctorType>
381 {
382 auto* Binding = Storage.Bind(Forward<FunctorType>(InFunc));
383
384 if constexpr (StorageType::bCanBeNull)
385 {
386 if (!Binding)
387 {
388 return;
389 }
390 }
391
392 using DecayedFunctorType = typename TRemovePointer<decltype(Binding)>::Type;
393
394 Callable = &TFunctionRefCaller<DecayedFunctorType, Ret, ParamTypes...>::Call;
395 }
396
399
400 UE_DEPRECATED(5.7, "CheckCallable should not be called - use check(Func) instead, and for a TFunctionRef there's no need to check.")
401 FORCENOINLINE void CheckCallable() const
402 {
403 checkf(Callable, TEXT("Attempting to call an unbound TFunction!"));
404 }
405
406 Ret operator()(ParamTypes... Params) const
407 {
408#if DO_CHECK
409 if constexpr (StorageType::bCanBeNull)
410 {
412 }
413#endif
414 return Callable(Storage.GetPtr(), Params...);
415 }
416
418 {
419 if constexpr (StorageType::bCanBeNull)
420 {
421 if (!Callable)
422 {
423 return;
424 }
425 }
426 Storage.Unbind();
427 }
428
432 void Reset()
433 {
434 if (Callable)
435 {
436 Storage.Unbind();
437 Callable = nullptr;
438 }
439 }
440
441 protected:
442 bool IsSet() const
443 {
444 // Normally we'd assert that bCanBeNull here because it should always be true, but we reuse this
445 // function to test that a `TOptional<TFunctionRef>` with an intrusive state is unset.
446
447 return !!Callable;
448 }
449
450 private:
451 // A pointer to a function which invokes the call operator on the callable object
452 Ret (*Callable)(void*, ParamTypes&...) = nullptr;
453
454 StorageType Storage;
455 };
456
458 {
459 constexpr static bool bCanBeNull = false;
460
461 template <typename FunctorType>
462 std::remove_reference_t<FunctorType>* Bind(FunctorType&& InFunc)
463 {
464 checkf(IsBound(InFunc), TEXT("Cannot bind a null/unbound callable to a TFunctionRef"));
465
466 Ptr = (void*)&InFunc;
467 return &InFunc;
468 }
469
471 {
472 Ptr = Other.Ptr;
473 }
474
478 void* GetPtr() const
479 {
480 return Ptr;
481 }
482
486 void Unbind() const
487 {
488 // FunctionRefs don't own their binding - do nothing
489 }
490
491 private:
492 // A pointer to the callable object
493 void* Ptr = nullptr;
494 };
495
496 template <typename FunctorType> auto ResolveFuncPtrTypeIfPossible(FunctorType&&, int) -> decltype(+std::declval<FunctorType>());
497 template <typename FunctorType> auto ResolveFuncPtrTypeIfPossible(FunctorType&&, ...) -> FunctorType&&;
498
499 template <typename FunctorType>
500 using TFuncPtrTypeIfPossible_T = decltype(ResolveFuncPtrTypeIfPossible(std::declval<FunctorType&&>(), 0));
501}
502
555template <typename Ret, typename... ParamTypes>
556class AUTORTFM_INFER TFunctionRef<Ret(ParamTypes...)> final : public UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::FFunctionRefStoragePolicy, Ret(ParamTypes...)>
557{
559
560public:
564 template <typename FunctorType>
565 requires (!TIsTFunctionRef<std::decay_t<FunctorType>>::Value && std::is_invocable_r_v<Ret, std::decay_t<FunctorType>, ParamTypes...>)
568 {
569 // This constructor is disabled for TFunctionRef types so it isn't incorrectly selected as copy/move constructors.
570
571 // Unlike TFunction and TUniqueFunction, we do not coerce the function type to a pointer here because the functionref would
572 // end up pointing to the temporary pointer we created on the stack.
573 }
574
576 // Start - intrusive TOptional<TFunctionRef> state //
578 constexpr static bool bHasIntrusiveUnsetOptionalState = true;
580
585 {
586 return !Super::IsSet();
587 }
589 // End - intrusive TOptional<TFunctionRef> state //
591
592 TFunctionRef(const TFunctionRef&) = default;
593
594 // We delete the assignment operators because we don't want it to be confused with being related to
595 // regular C++ reference assignment - i.e. calling the assignment operator of whatever the reference
596 // is bound to - because that's not what TFunctionRef does, nor is it even capable of doing that.
597 TFunctionRef& operator=(const TFunctionRef&) const = delete;
598 ~TFunctionRef() = default;
599};
600
638template <typename Ret, typename... ParamTypes>
639class AUTORTFM_INFER TFunction<Ret(ParamTypes...)> final : public UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<false>, Ret(ParamTypes...)>
640{
642
643public:
648 {
649 }
650
654 template <typename FunctorType>
655 requires (!TIsTFunction<std::decay_t<FunctorType>>::Value && std::is_invocable_r_v<Ret, std::decay_t<FunctorType>, ParamTypes...>)
656 TFunction(FunctorType&& InFunc)
658 {
659 // This constructor is disabled for TFunction types so it isn't incorrectly selected as copy/move constructors.
660
661 // This is probably a mistake if you expect TFunction to take a copy of what
662 // TFunctionRef is bound to, because that's not possible.
663 //
664 // If you really intended to bind a TFunction to a TFunctionRef, you can just
665 // wrap it in a lambda (and thus it's clear you're just binding to a call to another
666 // reference):
667 //
668 // TFunction<int32(float)> MyFunction = [MyFunctionRef](float F) { return MyFunctionRef(F); };
669 static_assert(!TIsTFunctionRef<std::decay_t<FunctorType>>::Value, "Cannot construct a TFunction from a TFunctionRef");
670 }
671
672 TFunction(TFunction&&) = default;
673 TFunction(const TFunction& Other) = default;
674 ~TFunction() = default;
675
680 {
681 Swap(*this, Other);
682 return *this;
683 }
684
689 {
690 TFunction Temp = Other;
691 Swap(*this, Temp);
692 return *this;
693 }
694
699 {
700 Super::Reset();
701 return *this;
702 }
703
707 FORCEINLINE explicit operator bool() const
708 {
709 return Super::IsSet();
710 }
711
715 FORCEINLINE bool IsSet() const
716 {
717 return Super::IsSet();
718 }
719
724 {
725 return !*this;
726 }
727
732 {
733 return (bool)*this;
734 }
735};
736
753template <typename Ret, typename... ParamTypes>
754class AUTORTFM_INFER TUniqueFunction<Ret(ParamTypes...)> final : public UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<true>, Ret(ParamTypes...)>
755{
757
758public:
763 {
764 }
765
769 template <typename FunctorType>
770 requires(!TIsTUniqueFunction<std::decay_t<FunctorType>>::Value && !TIsTFunction <std::decay_t<FunctorType>>::Value && std::is_invocable_r_v<Ret, std::decay_t<FunctorType>, ParamTypes...>)
771 TUniqueFunction(FunctorType&& InFunc)
773 {
774 // This constructor is disabled for TUniqueFunction types so it isn't incorrectly selected as copy/move constructors.
775
776 // This is probably a mistake if you expect TUniqueFunction to take a copy of what
777 // TFunctionRef is bound to, because that's not possible.
778 //
779 // If you really intended to bind a TUniqueFunction to a TFunctionRef, you can just
780 // wrap it in a lambda (and thus it's clear you're just binding to a call to another
781 // reference):
782 //
783 // TUniqueFunction<int32(float)> MyFunction = [MyFunctionRef](float F) { return MyFunctionRef(F); };
784 static_assert(!TIsTFunctionRef<std::decay_t<FunctorType>>::Value, "Cannot construct a TUniqueFunction from a TFunctionRef");
785 }
786
790 TUniqueFunction(TFunction<Ret(ParamTypes...)>&& Other)
791 : Super(MoveTemp(*(UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<false>, Ret(ParamTypes...)>*)&Other))
792 {
793 }
794
798 TUniqueFunction(const TFunction<Ret(ParamTypes...)>& Other)
799 : Super(*(const UE::Core::Private::Function::TFunctionRefBase<UE::Core::Private::Function::TFunctionStorage<false>, Ret(ParamTypes...)>*)&Other)
800 {
801 }
802
807 {
808 Swap(*this, Other);
809 return *this;
810 }
811
815 ~TUniqueFunction() = default;
816
820 void Reset()
821 {
822 *this = nullptr;
823 }
824
828 FORCEINLINE explicit operator bool() const
829 {
830 return Super::IsSet();
831 }
832
836 FORCEINLINE bool IsSet() const
837 {
838 return Super::IsSet();
839 }
840};
841
842
843#if !PLATFORM_COMPILER_HAS_GENERATED_COMPARISON_OPERATORS
847template <typename FuncType>
849{
850 return !Func;
851}
852
856template <typename FuncType>
858{
859 return (bool)Func;
860}
861#endif
862
863#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_4
864#include "Templates/AndOrNot.h"
865#include "Templates/Decay.h"
868#include "Templates/IsPointer.h"
871#endif
#define FORCENOINLINE
Definition AndroidPlatform.h:142
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define AUTORTFM_INFER
Definition AutoRTFMDefines.h:121
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define CA_ASSUME(Expr)
Definition CoreMiscDefines.h:126
#define UE_LIFETIMEBOUND
Definition Platform.h:812
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TYPE_OF_NULLPTR TYPE_OF_NULLPTR
The type of the C++ nullptr keyword.
Definition Platform.h:1157
#define COMPILE_WARNING(x)
Definition Platform.h:957
FORCEINLINE bool operator==(TYPE_OF_NULLPTR, const TFunction< FuncType > &Func)
Definition Function.h:848
FORCEINLINE bool operator!=(TYPE_OF_NULLPTR, const TFunction< FuncType > &Func)
Definition Function.h:857
AUTORTFM_INFER UE_FORCEINLINE_HINT constexpr auto Invoke(FuncType &&Func, ArgTypes &&... Args) -> decltype(((FuncType &&) Func)((ArgTypes &&) Args...))
Definition Invoke.h:44
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Core.Build.cs:8
TFunctionRef(FunctorType &&InFunc UE_LIFETIMEBOUND)
Definition Function.h:566
TFunctionRef(FIntrusiveUnsetOptionalState)
Definition Function.h:581
TFunctionRef & operator=(const TFunctionRef &) const =delete
bool operator==(FIntrusiveUnsetOptionalState) const
Definition Function.h:584
TFunctionRef(const TFunctionRef &)=default
Definition AssetRegistryState.h:50
TFunction & operator=(TFunction &&Other)
Definition Function.h:679
TFunction(TFunction &&)=default
TFunction & operator=(TYPE_OF_NULLPTR)
Definition Function.h:698
TFunction & operator=(const TFunction &Other)
Definition Function.h:688
FORCEINLINE bool IsSet() const
Definition Function.h:715
TFunction(TYPE_OF_NULLPTR=nullptr)
Definition Function.h:647
FORCEINLINE bool operator==(TYPE_OF_NULLPTR) const
Definition Function.h:723
TFunction(const TFunction &Other)=default
FORCEINLINE bool operator!=(TYPE_OF_NULLPTR) const
Definition Function.h:731
TFunction(FunctorType &&InFunc)
Definition Function.h:656
Definition AndroidPlatformMisc.h:14
TUniqueFunction & operator=(TUniqueFunction &&Other)
Definition Function.h:806
TUniqueFunction(const TUniqueFunction &Other)=delete
FORCEINLINE bool IsSet() const
Definition Function.h:836
TUniqueFunction(TFunction< Ret(ParamTypes...)> &&Other)
Definition Function.h:790
TUniqueFunction(TYPE_OF_NULLPTR=nullptr)
Definition Function.h:762
TUniqueFunction & operator=(const TUniqueFunction &Other)=delete
TUniqueFunction(const TFunction< Ret(ParamTypes...)> &Other)
Definition Function.h:798
void Reset()
Definition Function.h:820
TUniqueFunction(FunctorType &&InFunc)
Definition Function.h:771
TUniqueFunction(TUniqueFunction &&)=default
Definition FunctionFwd.h:19
Definition OverriddenPropertySet.cpp:45
Definition Function.cpp:6
decltype(ResolveFuncPtrTypeIfPossible(std::declval< FunctorType && >(), 0)) TFuncPtrTypeIfPossible_T
Definition Function.h:500
FORCEINLINE bool IsBound(const T &Func)
Definition Function.h:112
FORCENOINLINE void CheckCallable(void *Callable)
Definition Function.cpp:7
auto ResolveFuncPtrTypeIfPossible(FunctorType &&, int) -> decltype(+std::declval< FunctorType >())
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
Definition IntrusiveUnsetOptionalState.h:71
static FORCENOINLINE CORE_API void Free(void *Original)
Definition UnrealMemory.cpp:685
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
Definition FunctionFwd.h:52
Definition FunctionFwd.h:32
Definition FunctionFwd.h:42
Definition UnrealTemplate.h:511
void * GetPtr() const
Definition Function.h:478
std::remove_reference_t< FunctorType > * Bind(FunctorType &&InFunc)
Definition Function.h:462
static constexpr bool bCanBeNull
Definition Function.h:459
void Unbind() const
Definition Function.h:486
void BindCopy(const FFunctionRefStoragePolicy &Other)
Definition Function.h:470
FFunctionStorage & operator=(const FFunctionStorage &Other)=delete
void BindCopy(const FFunctionStorage &Other)
Definition Function.h:149
void * HeapAllocation
Definition Function.h:199
FFunctionStorage(FFunctionStorage &&Other)
Definition Function.h:136
void * GetPtr() const
Definition Function.h:170
FFunctionStorage()
Definition Function.h:131
FFunctionStorage(const FFunctionStorage &Other)=delete
FFunctionStorage & operator=(FFunctionStorage &&Other)=delete
void Unbind()
Definition Function.h:188
IFunction_OwnedObject * GetBoundObject() const
Definition Function.h:154
virtual void * CloneToEmptyStorage(FFunctionStorage *Storage) const =0
TFunctionRefBase(const TFunctionRefBase &Other)
Definition Function.h:365
TFunctionRefBase(TFunctionRefBase< OtherStorage, Ret(ParamTypes...)> &&Other)
Definition Function.h:335
TFunctionRefBase(TFunctionRefBase &&Other)
Definition Function.h:322
Ret operator()(ParamTypes... Params) const
Definition Function.h:406
TFunctionRefBase & operator=(const TFunctionRefBase &)=delete
TFunctionRefBase(const TFunctionRefBase< OtherStorage, Ret(ParamTypes...)> &Other)
Definition Function.h:349
static Ret Call(void *Obj, ParamTypes &... Params)
Definition Function.h:288
TFunctionStorage(FFunctionStorage &&Other)
Definition Function.h:207
std::decay_t< FunctorType > * Bind(FunctorType &&InFunc)
Definition Function.h:213
virtual void * GetAddress() override
Definition Function.h:81
~TFunction_OwnedObject() override
Definition Function.h:102
void * CloneToEmptyStorage(FFunctionStorage *UntypedStorage) const override
Definition Function.h:250
virtual void Destroy() override
Definition Function.h:88
TFunction_OwnedObject(ArgType &&Arg)
Definition Function.h:76