List all enum in a class

Bruno Deligny bruno.deligny at gmail.com
Thu Jun 13 05:03:08 PDT 2013


Hi,

I tried that but in doesn't print anything:

foreach (member; __traits(allMembers, type))
{
	static if (is(typeof(__traits(getMember, type, member)) == enum))
	{
		writeln(member);
	}
}

I tried a lot of other ways but nothing compile.

thx


More information about the Digitalmars-d-learn mailing list