![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <Function.h>
Inheritance diagram for uLang::TUniqueFunction< FuncType >:Public Member Functions | |
| TUniqueFunction (NullPtrType=nullptr) | |
| template<typename FunctorType , typename = typename TEnableIf< TAnd< TNot<TOr<TIsTUniqueFunction<typename TDecay<FunctorType>::Type>, TIsTFunction<typename TDecay<FunctorType>::Type>>>, Private::TFuncCanBindToFunctor<FuncType, FunctorType> >::Value >::Type> | |
| TUniqueFunction (FunctorType &&InFunc) | |
| TUniqueFunction (TFunction< FuncType > &&Other) | |
| TUniqueFunction (const TFunction< FuncType > &Other) | |
| TUniqueFunction & | operator= (TUniqueFunction &&Other) |
| TUniqueFunction (TUniqueFunction &&)=default | |
| TUniqueFunction (const TUniqueFunction &Other)=delete | |
| TUniqueFunction & | operator= (const TUniqueFunction &Other)=delete |
| ~TUniqueFunction ()=default | |
| void | Reset () |
| ULANG_FORCEINLINE | operator bool () const |
TUniqueFunction<FuncType>
See the class definition for intended usage.
TUniqueFunction<FuncType>
Used like TFunction above, but is move-only. This allows non-copyable functors to be bound to it.
Example:
TUniquePtr<FThing> Thing = MakeUnique<FThing>();
TFunction <void()> CopyableFunc = [Thing = Move(Thing)](){ Thing->DoSomething(); }; // error - lambda is not copyable TUniqueFunction<void()> MovableFunc = [Thing = Move(Thing)](){ Thing->DoSomething(); }; // ok
void Foo(TUniqueFunction<void()> Func); Foo(MovableFunc); // error - TUniqueFunction is not copyable Foo(Move(MovableFunc)); // ok
|
inline |
Default constructor.
|
inline |
Constructor which binds a TFunction to any function object.
|
inline |
Constructor which takes ownership of a TFunction's functor.
|
inline |
Constructor which takes ownership of a TFunction's functor.
|
default |
|
delete |
|
default |
|
inlineexplicit |
Tests if the TUniqueFunction is callable.
|
delete |
|
inline |
Copy/move assignment operator.
|
inline |
Removes any bound callable from the TFunction, restoring it to the default 'empty' state.