Examining Members of a module at Compile Time

2014-05-29 Thread Meta via Digitalmars-d-learn
I'd like to get a list of all classes in the current module, so I came up with this code: class Test {} class TestChild: Test {} class TestChildChild: TestChild {} void main() { foreach (item; __traits(allMembers, mixin(__MODULE__))) { static if

Re: Examining Members of a module at Compile Time

2014-05-29 Thread Dicebot via Digitalmars-d-learn
class Test {} class TestChild: Test {} class TestChildChild: TestChild {} alias Alias(alias Symbol) = Symbol; // this does the trick void main() { foreach (item; __traits(allMembers, mixin(__MODULE__))) { alias sym = Alias!(__traits(getMember, mixin(__MODULE__), item));

Re: Examining Members of a module at Compile Time

2014-05-29 Thread Meta via Digitalmars-d-learn
On Thursday, 29 May 2014 at 23:18:32 UTC, Dicebot wrote: class Test {} class TestChild: Test {} class TestChildChild: TestChild {} alias Alias(alias Symbol) = Symbol; // this does the trick void main() { foreach (item; __traits(allMembers, mixin(__MODULE__))) { alias sym =