_makeEnumAliases

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. mixin template _ExportEnumMembers(E)
  2. string _makeEnumAliases()
    package
    string
    _makeEnumAliases
    (
    E
    )
    (
    )
    if (
    is(E == enum)
    )

Examples

1 enum enum_type_t
2 {
3     foo,
4     bar,
5 }
6 
7 mixin _ExportEnumMembers!enum_type_t;
8 
9 enum_type_t e1 = enum_type_t.foo;  // ok
10 enum_type_t e2 = bar;    // ok

Meta