Navigation
API > API/Runtime > API/Runtime/Core
Overloads
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TUniquePtr< T > MakeUnique
(
TArgs&&... Args |
Allocates a new object of type T with the given arguments and returns it as a TUniquePtr. | Templates/UniquePtr.h | |
TUniquePtr< T > MakeUnique
(
SIZE_T Size |
Allocates a new array of type T with the given size and returns it as a TUniquePtr. | Templates/UniquePtr.h |
MakeUnique(TArgs &&...)
Description
Allocates a new object of type T with the given arguments and returns it as a TUniquePtr. Disabled for array-type TUniquePtrs. The object is value-initialized, which will call a user-defined default constructor if it exists, but a trivial type will be zeroed.
Overload to cause a compile error when MakeUnique
| Name | MakeUnique |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/UniquePtr.h |
| Include Path | #include "Templates/UniquePtr.h" |
template<typename T, typename... TArgs, std::enable_if_t<(!std::is_array_v< T >), int >>
TUniquePtr < T > MakeUnique
(
TArgs &&... Args
)
A TUniquePtr which points to a newly-constructed T with the specified Args.
Parameters
| Name | Remarks |
|---|---|
| Args | The arguments to pass to the constructor of T. |
MakeUnique(SIZE_T)
Description
Allocates a new array of type T with the given size and returns it as a TUniquePtr. Only enabled for array-type TUniquePtrs. Elements are value-initialized, which will call a user-defined default constructor if it exists, but causes trivial types to be zeroed.
| Name | MakeUnique |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/UniquePtr.h |
| Include Path | #include "Templates/UniquePtr.h" |
template<typename T, std::enable_if_t<< T >::Value ), int >>
TUniquePtr < T > MakeUnique
(
SIZE_T Size
)
A TUniquePtr which points to a newly-constructed T array of the specified Size.
Parameters
| Name | Remarks |
|---|---|
| Size | The size of the array to allocate. |