Navigation
API > API/Runtime > API/Runtime/Core
Exception-safe guard around saving/restoring a value. Commonly used to make sure a value is restored even if the code early outs in the future. Usage: TGuardValue
| Name | TGuardValue |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Templates/UnrealTemplate.h |
| Include Path | #include "Templates/UnrealTemplate.h" |
Syntax
template<typename RefType, typename AssignedType>
struct TGuardValue : private FNoncopyable
Inheritance Hierarchy
- CNoncopyable → TGuardValue
- FNoncopyable → TGuardValue
Derived Classes
TGuardValue derived class hierarchy
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TGuardValue
(
RefType& ReferenceValue, |
Templates/UnrealTemplate.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TGuardValue() |
Templates/UnrealTemplate.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OriginalValue | AssignedType | Templates/UnrealTemplate.h | ||
| RefValue | RefType & | Templates/UnrealTemplate.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const AssignedType & GetOriginalValue() |
Provides read-only access to the original value of the data being tracked by this struct | Templates/UnrealTemplate.h |