digitalmars.D.learn - __traits(getMember, ...) on instance member
Hi, Something has been confusing me, regarding passing around aliases of instance members. If I can say: struct S { int m; } pragma(msg, (S).m); How come I can't say: struct S { int m; } pragma(msg, __traits(getMember, S, m)); ? What's the difference, and what does each one mean? (I'm trying to create a MembersTuple(T) template that returns a tuple of all members, but this stumbling block is pretty much fatal to my implementation.) Thank you!
Jan 15 2011
Sorry, I just noticed a typo. The line saying pragma(msg, __traits(getMember, S, m)); should've said: pragma(msg, __traits(getMember, S, "m"));
Jan 15 2011