UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TEnumAsByte< InEnumType > Class Template Reference

#include <EnumAsByte.h>

Public Types

using EnumType = InEnumType
 

Public Member Functions

constexpr TEnumAsByte ()=default
 
constexpr TEnumAsByte (const TEnumAsByte &)=default
 
constexpr TEnumAsByteoperator= (const TEnumAsByte &)=default
 
UE_FORCEINLINE_HINT constexpr TEnumAsByte (EnumType InValue)
 
UE_FORCEINLINE_HINT constexpr TEnumAsByte (int32 InValue)
 
UE_FORCEINLINE_HINT constexpr TEnumAsByte (uint8 InValue)
 
constexpr bool operator== (EnumType InValue) const
 
constexpr bool operator== (TEnumAsByte InValue) const
 
constexpr operator EnumType () const
 
constexpr EnumType GetValue () const
 
constexpr uint8 GetIntValue () const
 

Detailed Description

template<class InEnumType>
class TEnumAsByte< InEnumType >

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.

Examples
/work/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

Member Typedef Documentation

◆ EnumType

template<class InEnumType >
using TEnumAsByte< InEnumType >::EnumType = InEnumType

Constructor & Destructor Documentation

◆ TEnumAsByte() [1/5]

template<class InEnumType >
constexpr TEnumAsByte< InEnumType >::TEnumAsByte ( )
constexprdefault

◆ TEnumAsByte() [2/5]

template<class InEnumType >
constexpr TEnumAsByte< InEnumType >::TEnumAsByte ( const TEnumAsByte< InEnumType > &  )
constexprdefault

◆ TEnumAsByte() [3/5]

template<class InEnumType >
UE_FORCEINLINE_HINT constexpr TEnumAsByte< InEnumType >::TEnumAsByte ( EnumType  InValue)
inlineconstexpr

Constructor, initialize to the enum value.

Parameters
InValuevalue to construct with.

◆ TEnumAsByte() [4/5]

template<class InEnumType >
UE_FORCEINLINE_HINT constexpr TEnumAsByte< InEnumType >::TEnumAsByte ( int32  InValue)
inlineexplicitconstexpr

Constructor, initialize to the int32 value.

Parameters
InValuevalue to construct with.

◆ TEnumAsByte() [5/5]

template<class InEnumType >
UE_FORCEINLINE_HINT constexpr TEnumAsByte< InEnumType >::TEnumAsByte ( uint8  InValue)
inlineexplicitconstexpr

Constructor, initialize to the uint8 value.

Parameters
InValuevalue to construct with.

Member Function Documentation

◆ GetIntValue()

template<class InEnumType >
constexpr uint8 TEnumAsByte< InEnumType >::GetIntValue ( ) const
inlineconstexpr

Gets the integer enumeration value.

Returns
The enumeration value.

◆ GetValue()

template<class InEnumType >
constexpr EnumType TEnumAsByte< InEnumType >::GetValue ( ) const
inlineconstexpr

Gets the enumeration value.

Returns
The enumeration value.

◆ operator EnumType()

template<class InEnumType >
constexpr TEnumAsByte< InEnumType >::operator EnumType ( ) const
inlineconstexpr

Implicit conversion to EnumType.

◆ operator=()

template<class InEnumType >
constexpr TEnumAsByte & TEnumAsByte< InEnumType >::operator= ( const TEnumAsByte< InEnumType > &  )
constexprdefault

◆ operator==() [1/2]

template<class InEnumType >
constexpr bool TEnumAsByte< InEnumType >::operator== ( EnumType  InValue) const
inlineconstexpr

Compares two enumeration values for equality.

Parameters
InValueThe value to compare with.
Returns
true if the two values are equal, false otherwise.

◆ operator==() [2/2]

template<class InEnumType >
constexpr bool TEnumAsByte< InEnumType >::operator== ( TEnumAsByte< InEnumType InValue) const
inlineconstexpr

Compares two enumeration values for equality.

Parameters
InValueThe value to compare with.
Returns
true if the two values are equal, false otherwise.

The documentation for this class was generated from the following file: