Navigation
API > API/Runtime > API/Runtime/Core
Template to store enumeration values as bytes in a type-safe way. Blueprint enums should either be enum classes (preferred): enum class EMyEnum : uint8 { One, Two }, which doesn't require wrapping in this template or a namespaced enum namespace EMyEnum { enum Type // <- literally Type, not a placeholder { One, Two }; }
Traits classes and constants which test if a type is a TEnumAsByte.
| Name | TEnumAsByte |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/EnumAsByte.h |
| Include Path | #include "Containers/EnumAsByte.h" |
Syntax
template<class InEnumType>
class TEnumAsByte
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr TEnumAsByte () |
Containers/EnumAsByte.h | ||
constexpr TEnumAsByte
(
const TEnumAsByte& |
Containers/EnumAsByte.h | ||
constexpr TEnumAsByte
(
EnumType InValue |
Constructor, initialize to the enum value. | Containers/EnumAsByte.h | |
constexpr TEnumAsByte
(
int32 InValue |
Constructor, initialize to the int32 value. | Containers/EnumAsByte.h | |
constexpr TEnumAsByte
(
uint8 InValue |
Constructor, initialize to the uint8 value. | Containers/EnumAsByte.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EnumType | InEnumType | Containers/EnumAsByte.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Value | uint8 | Holds the value as a byte. | Containers/EnumAsByte.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint8 GetIntValue() |
Gets the integer enumeration value. | Containers/EnumAsByte.h | |
EnumType GetValue() |
Gets the enumeration value. | Containers/EnumAsByte.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
constexpr operator EnumType() |
Implicit conversion to EnumType. | Containers/EnumAsByte.h | |
TEnumAsByte & operator=
(
const TEnumAsByte& |
Containers/EnumAsByte.h | ||
bool operator==
(
EnumType InValue |
Compares two enumeration values for equality. | Containers/EnumAsByte.h | |
bool operator==
(
TEnumAsByte InValue |
Compares two enumeration values for equality. | Containers/EnumAsByte.h |