Navigation
API > API/Runtime > API/Runtime/Core
TNonNullPtr is a non-nullable, non-owning, raw/naked/unsafe pointer.
| Name | TNonNullPtr |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/NonNullPointer.h |
| Include Path | #include "Templates/NonNullPointer.h" |
Syntax
template<typename ObjectType>
class TNonNullPtr
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TNonNullPtr
(
const TNonNullPtr< OtherObjectType >& Other |
Constructs a non-null pointer from another non-null pointer | Templates/NonNullPointer.h | |
| Hack that can be used under extraordinary circumstances | Templates/NonNullPointer.h | ||
TNonNullPtr
(
TYPE_OF_NULLPTR |
Nullptr constructor - not allowed. | Templates/NonNullPointer.h | |
TNonNullPtr
(
ObjectType* InObject |
Constructs a non-null pointer from the provided pointer. Must not be nullptr. | Templates/NonNullPointer.h | |
| Templates/NonNullPointer.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| IntrusiveUnsetOptionalStateType | TNonNullPtr | Templates/NonNullPointer.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bHasIntrusiveUnsetOptionalState | bool | Start - intrusive TOptional |
Templates/NonNullPointer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Object | ObjectType * | The object we're holding a reference to. | Templates/NonNullPointer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ObjectType * Get() |
Returns the internal pointer | Templates/NonNullPointer.h | |
bool IsInitialized () |
WARNING: Hack that can be used under extraordinary circumstances. | Templates/NonNullPointer.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator bool() |
Use IsInitialized if needed | Templates/NonNullPointer.h | |
operator ObjectType *() |
Returns the internal pointer | Templates/NonNullPointer.h | |
bool operator!=
(
const TNonNullPtr& Other |
Templates/NonNullPointer.h | ||
bool operator!=
(
OtherObjectType* Other |
Templates/NonNullPointer.h | ||
ObjectType & operator*() |
Dereference operator returns a reference to the object this pointer points to | Templates/NonNullPointer.h | |
TNonNullPtr & operator=
(
const TNonNullPtr< OtherObjectType >& Other |
Assignment operator taking another TNonNullPtr | Templates/NonNullPointer.h | |
TNonNullPtr & operator=
(
ObjectType* InObject |
Assignment operator taking a pointer | Templates/NonNullPointer.h | |
TNonNullPtr & operator=
(
TYPE_OF_NULLPTR |
Assignment operator taking a nullptr - not allowed. | Templates/NonNullPointer.h | |
bool operator==
(
const TNonNullPtr& Other |
Comparison, will also handle default constructed state | Templates/NonNullPointer.h | |
bool operator==
(
OtherObjectType* Other |
Comparison with a raw pointer | Templates/NonNullPointer.h | |
bool operator==
(
FIntrusiveUnsetOptionalState |
Templates/NonNullPointer.h | ||
ObjectType * operator->() |
Arrow operator returns a pointer to this pointer's object | Templates/NonNullPointer.h |