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 (is(mixin(item)
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));
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 = A