1

How would I create an enum of class references in D? (They all implement the same interface)

This is what I have tried:

enum byteCommands : ByteCommand*
{
    END_OF_CODE     = null,
    PRINT_VAR       = PrintVarCommand*
}
Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Jeroen
  • 15,257
  • 12
  • 59
  • 102

1 Answers1

1

It is not possible to create enums of class references. Enums must be compile-time constants, which references are not.

Jeroen
  • 15,257
  • 12
  • 59
  • 102