Navigation
API > API/Runtime > API/Runtime/Core
Type to wrap a global variable and prevent its destructor being called. The destructor of this type cannot be trivial, but it is empty and compilers should not register an atexit call for the object.
| Name | TNoDestroy |
| Type | union |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/NoDestroy.h |
| Include Path | #include "Templates/NoDestroy.h" |
Syntax
template<typename T>
union TNoDestroy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr TNoDestroy
(
ArgTypes&&... InArgs |
Templates/NoDestroy.h | ||
TNoDestroy
(
TNoDestroy&& |
Templates/NoDestroy.h | ||
TNoDestroy
(
const TNoDestroy& |
Templates/NoDestroy.h | ||
consteval TNoDestroy
(
ENoDestroyConstEval, |
Templates/NoDestroy.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr ~TNoDestroy() |
Templates/NoDestroy.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ElementType | T | Templates/NoDestroy.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Value | ElementType | Templates/NoDestroy.h |
Functions
Public
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ElementType * operator& () |
Templates/NoDestroy.h | ||
const ElementType * operator& () |
Templates/NoDestroy.h | ||
ElementType & operator* () |
Templates/NoDestroy.h | ||
const ElementType & operator* () |
Templates/NoDestroy.h | ||
TNoDestroy & operator=
(
const TNoDestroy& |
Templates/NoDestroy.h | ||
TNoDestroy & operator=
(
TNoDestroy&& |
Templates/NoDestroy.h | ||
ElementType * operator-> () |
Templates/NoDestroy.h | ||
const ElementType * operator-> () |
Templates/NoDestroy.h |