Generating code based on UDA

Rares Pop via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 26 00:28:38 PDT 2014


I have found the problem.
It was the nested mixin that was causing the scope degradation 
(not sure if that is intended behaviour).

The correct way to iterate through members and get their 
attribute is  like this:

foreach(member; __traits(allMembers,T))
	{		
		enum fullName = format("%s.%s", T.stringof, member);
		pragma(msg, "member: ", fullName);
		foreach(attr; __traits(getAttributes, __traits(getMember, T, 
member)))
		{
....




More information about the Digitalmars-d-learn mailing list