MakeUnique

Allocates a new array of type T with the given size and returns it as a [TUniquePtr](API\Runtime\Core\Templates\TUniquePtr).

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Templates/UniquePtr.h

Include

#include "Templates/UniquePtr.h"

Syntax

template<typename T>
TEnableIf< TIsUnboundedArray< T >::Value, TUniquePtr< T > >::Type MakeUnique
(
    SIZE_T Size
)

Remarks

Allocates a new array of type T with the given size and returns it as a TUniquePtr. Only enabled for array-type TUniquePtrs.

Returns

A TUniquePtr which points to a newly-constructed T array of the specified Size.

Parameters

Parameter

Description

Size

The size of the array to allocate.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss