How do I get the protection status of function in another module?

Basically I have some code that loops through all the members of another module and I want to be able to skip the ones that are private.

The code below prints public for foo.

module A;

private void foo();

--------------------------------

module B;

import A;

void main()
{
    import std.stdio : writeln;

    foreach(member; __traits(allMembers, A))
    {
        writeln(member);
        writeln(__traits(getProtection, member));
    }
}

Reply via email to