_ExportEnumMembers

Export all enum members as aliases. This allows enums to be used as types and allows its members to be used as if they're defined in module scope.

  1. mixintemplate _ExportEnumMembers(E)
    package
    mixin template _ExportEnumMembers (
    E
    ) if (
    is(E == enum)
    )
  2. string _makeEnumAliases()

Examples

enum enum_type_t
{
    foo,
    bar,
}

mixin _ExportEnumMembers!enum_type_t;

enum_type_t e1 = enum_type_t.foo;  // ok
enum_type_t e2 = bar;    // ok

Meta