UHT support for C++11 enum class

This would make the whole namespace scoping thing unnecessary and would be super rad awesome!

Hi,

Initial support for enum classes have just recently been added!

https://github.com/EpicGames/UnrealEngine/commit/82fcd06c4230cb3988cde647ae50e78100a4c0f1

It’s only partially supported at the moment, because the property system currently handles enums as bytes (hence the TEnumAsByte template), so your enum classes must be based on bytes (i.e. uint8).

But it does allow you to replace:

UENUM(...)
namespace EThing
{
       enum Type
       {
              Thing1,
              Thing2
       };
}

UPROPERTY(...)
TEnumAsByte<EThing::Type> ThingProp;

… with:

UENUM(...)
enum class EThing : uint8
{
    Thing1,
    Thing2
};

UPROPERTY(...)
EThing ThingProp;

Hope this is helpful to you. :slight_smile:

Steve

Very, Thanks!