Language:
Discover
By Skill Level
By Category

TUniquePtr

Choose your OS:

Inheritance Hierarchy

Deleter

TUniquePtr

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

T *

 

Get()

Returns a pointer to the owned object without relinquishing ownership.

Public function

const Delete...

 

GetDeleter()

Returns a reference to the deleter subobject.

A reference to the deleter.

Public function

Deleter &

 

GetDeleter()

Returns a reference to the deleter subobject.

A reference to the deleter.

Public function

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

 

operator bool()

Operator bool

Public function

bool

 

operator!()

Logical not operator

Public function

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

T *

 

operator->()

Indirection operator

References

Module

Core

Header

Runtime/Core/Public/Templates/UniquePtr.h