Well, unashamedly copying from my own code, I have a template defined thusly:
enum isMemberFunction(T, string member) = is(typeof(__traits(getMember, T.init, member)) == function); Where `T` is the type that `member` is a part of. You can also change `function` to any of class, interface, struct, enum, or union, do find out if the member is one of those. The only way I know of to determine if a member is a field though, is to determine that it is not a class, function, interface, struct, enum, or union. As to the second question, I suspect I'm failing at understanding what your asking, so I'll leave it to someone else (who's probably a bit more awake than I am) to answer that one. On 1/1/14, Frustrated <c1514...@drdrb.com> wrote: > How does one determine if a member is a method and not anything > else? > > Also, how does one get the exact code string of a member instead > of having to piece it together from info from std.traits? (which > requires a lot of work)? > >