TNonNullPtr

[TNonNullPtr](API\Runtime\Core\Templates\TNonNullPtr) is a non-nullable, non-owning, raw/naked/unsafe pointer.

Windows
MacOS
Linux

References

Module

Core

Header

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

Include

#include "Templates/NonNullPointer.h"

Syntax

template<typename ObjectType>
class TNonNullPtr

Remarks

TNonNullPtr is a non-nullable, non-owning, raw/naked/unsafe pointer.

Constructors

Name Description

Public function

TNonNullPtr

Hack that can be used under extraordinary circumstances

Public function

TNonNullPtr

(
    TYPE_OF_NULLPTR
)

Nullptr constructor - not allowed.

Public function

TNonNullPtr

(
    OtherObjectType* InObject
)

Constructs a non-null pointer from the provided pointer. Must not be nullptr.

Public function

TNonNullPtr

(
    TNonNullPtr< OtherObjectType >& Ot...
)

Constructs a non-null pointer from another non-null pointer

Functions

Name Description

Public function Const

ObjectType &...

 

Get()

Returns the internal pointer

Operators

Name Description

Public function Const

 

operator ObjectType *()

Returns the internal pointer

Public function Const

ObjectType &

 

operator*()

Dereference operator returns a reference to the object this pointer points to

Public function

TNonNullPtr ...

 

operator=

(
    TYPE_OF_NULLPTR
)

Assignment operator taking a nullptr - not allowed.

Public function

TNonNullPtr ...

 

operator=

(
    OtherObjectType* InObject
)

Assignment operator taking a pointer

Public function

TNonNullPtr ...

 

operator=

(
    TNonNullPtr< OtherObjectType >& Ot...
)

Assignment operator taking another TNonNullPtr

Public function Const

ObjectType &...

 

operator->()

Arrow operator returns a pointer to this pointer's object

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