TUniquePtr

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Core

Header

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

Include

#include "Templates/UniquePtr.h"

Syntax

template<typename T, typename Deleter>
class TUniquePtr : private Deleter

Specializations

Constructors

Name Description

Public function

TUniquePtr()

Default constructor - initializes the TUniquePtr to null.

Public function

TUniquePtr

(
    T* InPtr
)

Pointer constructor - takes ownership of the pointed-to object

Public function

TUniquePtr

(
    TYPE_OF_NULLPTR
)

Nullptr constructor - initializes the TUniquePtr to null.

Public function

TUniquePtr

(
    TUniquePtr&& Other
)

Move constructor

Public function

TUniquePtr

(
    TUniquePtr< OtherT, OtherDeleter > ...
)

Constructor from rvalues of other (usually derived) types

Destructors

Name Description

Public function

~TUniquePtr()

Destructor

Functions

Name Description

Public function Const

T *

 

Get()

Returns a pointer to the owned object without relinquishing ownership.

Public function Const

const Delete...

 

GetDeleter()

Returns a reference to the deleter subobject.

Public function

Deleter &

 

GetDeleter()

Returns a reference to the deleter subobject.

Public function Const

bool

 

IsValid()

Tests if the TUniquePtr currently owns an object.

Public function

T *

 

Release()

Relinquishes control of the owned object to the caller and nulls the TUniquePtr.

Public function

void

 

Reset

(
    T* InPtr
)

Gives the TUniquePtr a new object to own, destroying any previously-owned object.

Operators

Name Description

Public function Const

 

operator bool()

Operator bool

Public function Const

bool

 

operator!()

Logical not operator

Public function Const

T &

 

operator*()

Dereference operator

Public function

TUniquePtr &

 

operator=

(
    TUniquePtr&& Other
)

Move assignment operator

Public function

TEnableIf<&#...

 

operator=

(
    TUniquePtr< OtherT, OtherDeleter > ...
)

Assignment operator for rvalues of other (usually derived) types

Public function

TUniquePtr &

 

operator=

(
    TYPE_OF_NULLPTR
)

Nullptr assignment operator

Public function Const

T *

 

operator->()

Indirection operator

Typedefs

Name

Description

ElementType

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback