On Tue, Jan 20, 2009 at 2:13 PM, Trass3r <mrmoc...@gmx.de> wrote: > Yeah, __traits works quite well to get the function names, but I still can't > manage to get the corresponding function object to pass it to > ParameterTypeTuple (for checking the parameters for correctness).
Ah, that's what __traits(getMember) is for. You pass it an object/class and a string of the member name, and it gives you what it corresponds to. > Tried using ClassInfo's getMembers function but that apparently doesn't > work. > > Base base = new Base; > auto members = __traits(allMembers, typeof(base)); > foreach(m; members) > writefln(base.classinfo.getMembers(m).length); > > gives 0 for every member :( I think that's actually a bug. DMD doesn't generate that info for some reason. I think LDC does.