[Issue 3744] __traits getMember error in checking of second argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 28 11:09:27 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3744



--- Comment #6 from Don <clugdbug at yahoo.com.au> 2010-01-28 11:09:25 PST ---
Actually, there's nothing at all wrong with __traits(getMember).
Really, you are asking for static foreach: given a compile-time constant array,
iterate over each of its members.
Since static foreach is unfortunately not going to happen (it was on Andrei's
list, but Walter rejected it), the other possibilities are to make
__traits(allMembers) into a tuple, or to use the static foreach workaround:

Something like:

enum a = __traits(allMembers, ...)'
foreach(T, int indx; ForEachTuple!(a.length))
{
   a = __traits(getMember, a[indx]);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list