Choose your operating system:
Windows
macOS
Linux
| TFunctionRefBase
|
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Templates/Function.h |
Include |
#include "Templates/Function.h" |
template<typename FuncType>
class TUniqueFunction : public UE::Core::Private::Function::TFunctionRefBase< UE::Core::Private::Function::TFunctionStorage< true >, FuncType >
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 = MoveTemp(Thing)](){ Thing->DoSomething(); }; // error - lambda is not copyable TUniqueFunction<void()> MovableFunc = [Thing = MoveTemp(Thing)](){ Thing->DoSomething(); }; // ok
void Foo(TUniqueFunction<void()> Func); Foo(MovableFunc); // error - TUniqueFunction is not copyable Foo(MoveTemp(MovableFunc)); // ok
Name | Description | |
---|---|---|
|
TUniqueFunction |
Default constructor. |
|
TUniqueFunction ( |
Constructor which binds a TFunction to any function object. |
|
TUniqueFunction ( |
Constructor which takes ownership of a TFunction's functor. |
|
TUniqueFunction ( |
Constructor which takes ownership of a TFunction's functor. |
|
TUniqueFunction ( |
|
|
TUniqueFunction ( |
Name | Description | |
---|---|---|
|
~TUniqueFunction() |
Name | Description | ||
---|---|---|---|
|
operator bool() |
Tests if the TUniqueFunction is callable. |
|
|
TUniqueFunct... |
operator= ( |
Copy/move assignment operator. |
|
TUniqueFunct... |
operator= ( |
Name |
Description |
---|---|
Super |