Compile-type array of classes?

2014-02-23 Thread Gordon
Hello, I'm sure this can be done, I'm just not sure what are the correct terms to search for... Given one interface, and multiple implementation classes, I want to create a list of the classes (in compile time). A contrived example: === interface Animal { static const string name() @proper

Re: Compile-type array of classes?

2014-02-23 Thread anonymous
On Sunday, 23 February 2014 at 20:34:07 UTC, Gordon wrote: Hello, I'm sure this can be done, I'm just not sure what are the correct terms to search for... Given one interface, and multiple implementation classes, I want to create a list of the classes (in compile time). A contrived example:

Re: Compile-type array of classes?

2014-02-23 Thread Gordon
On Sunday, 23 February 2014 at 20:52:58 UTC, anonymous wrote: On Sunday, 23 February 2014 at 20:34:07 UTC, Gordon wrote: Given one interface, and multiple implementation classes, I want to create a list of the classes (in compile time). import std.typetuple: TypeTuple; alias available_animal

Re: Compile-type array of classes?

2014-02-23 Thread Tobias Pankrath
On Sunday, 23 February 2014 at 22:14:17 UTC, Gordon wrote: On Sunday, 23 February 2014 at 20:52:58 UTC, anonymous wrote: On Sunday, 23 February 2014 at 20:34:07 UTC, Gordon wrote: Given one interface, and multiple implementation classes, I want to create a list of the classes (in compile time

Re: Compile-type array of classes?

2014-02-23 Thread Steven Schveighoffer
On Sun, 23 Feb 2014 17:14:16 -0500, Gordon wrote: Compiling with the marked writeln, produces an "underfined reference" error: $ rdmd animals.d /tmp/.rdmd-34574/rdmd-animals.d-796CFD5A46BFE9DF13BF873F65EA656C/objs/animals.o: In function `_Dmain': animals.d:(.text._Dmain+0xdf): undefine