[Issue 1386] "string expected" when using allMembers-element in __traits(getMember, ...)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 31 00:56:34 PDT 2007


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





------- Comment #1 from samukha at voliacable.com  2007-07-31 02:56 -------
__traits works only with strings known at compile time and in your example
'member' is evaluated at run-time. However, allMembers trait evaluates to an
array literal, so there should be a way to iterate through it at compile time.
Unfortunately, D doesn't have true 'static foreach' and you probably have to
resort to hacks.    


-- 



More information about the Digitalmars-d-bugs mailing list