Using UEnum::GetValueAsString to get an enum class value results in a warning:
"EnumAsByte.h(20): [C4996] 'TEnumAsByte_EnumClass<true>': TEnumAsByte is not intended for use with enum classes - please derive your enum class from uint8 instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile."
Example code
Enum:
UENUM(BlueprintType)
enum class EResourceType : uint8
{
Money,
Population,
MarketSentiment
}
Use:
FString const ResourceString = UEnum::GetValueAsString<EResourceType>(ResourceType); // ResourceType is of type EResourceType.
GetValueAsString overloads: GetValueAsString | Unreal Engine Documentation
The enum is derived from uint8. How does one get the values as string from an enum class?
Thanks.