[Issue 15371] __traits(getMember) should bypass the protection

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 31 13:54:59 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15371

--- Comment #4 from b2.temp at gmx.com ---
In the meantime, when the trait code is for a struct or a class it's possible
to use its '.tupleof' property. It's not affected by the visibility.

Instead of all member:

    import std.meta: aliasSeqOf;
    import std.range: iota;
    foreach(i;  aliasSeqOf!(iota(0, T.tupleof.length)))
    {
        alias MT = typeof(T.tupleof[i]);
        ...
    } 

This is not exactly the same but when the trait code is to inspect the variable
types or UDAs it works fine.

--


More information about the Digitalmars-d-bugs mailing list