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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 1 15:54:50 PDT 2009


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





------- Comment #6 from mrmocool at gmx.de  2009-04-01 17:54 -------
Ok, sorry didn't know.

Finally managed to compile a workaround:
template Sequence(size_t count, size_t index = 0)
{
        static if (index < count)
                alias Tuple!(index, Sequence!(count, index + 1)) Sequence;  
        else
                alias Tuple!() Sequence;
}

        static const members = __traits (allMembers, foo);
        foreach (i; Sequence!(members.length))
        {
                foreach (p; ParameterTypeTuple!(__traits(getMember, foo,
members[i])))
                        writefln(typeid(p));
        }


-- 



More information about the Digitalmars-d-bugs mailing list