Max value of enum

This may be a very simple question, but what is the maximum value of an enumerator? Because if cant seem to find it anywhere.

By the way I want to use the enum to store perk names.

For Enums, I usually add a MAX/NUM to the enum. You can set these to hidden in the editor as well:

UENUM(BlueprintType)
enum class ESomePattern : uint8
{
	NONE						UMETA(DisplayName = "No Pattern"),
	Stars						UMETA(DisplayName = "Stars"),
	Crowns						UMETA(DisplayName = "Crowns"),
	Moons						UMETA(DisplayName = "Moons"),

	NUM							UMETA(Hidden)
};
1 Like

Thanks for your answer. But I really need to know how long the enum can be. So I know that Uint8 has a max value of 255 but is there a way to increase the maximum value? For example by something else than an enum. I know that an integer can go really high but with an integer I can’t store any names with the values. So is there some kind of thing that can go higher than 255 but still keeps the handy naming?

By the way I am working with blueprints.

Sincerely,

I don’t think BlueprintType enums support anything above a uint8? What are you needing more than 255 enum values for? You could look at using a TMap to possibly help with your solution.

//EWallFace is a UENUM type
UEnum* MyEnum = StaticEnum();

int32 countOfMyEnum = MyEnum->GetMaxEnumValue();

//also loop this enum
for (int i = 0; i < countOfMyEnum ; i++)
{
   EWallFace currValue = EWallFace(MyEnum->GetValueByIndex(i));
}
1 Like