www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Determining protection of another module's member

__traits(getProtection) allows us to know if something is 
private, protected, etc. But how would one go about determining 
that from another module? The problem here is if module foo 
defines a function foofunc that is private, trying to use 
__traits(getProtection) from another module fails to compile.

The problem I'm trying to solve is how to determine if another 
module's member is private without having to resort to 
__traits(compiles). If you're wondering how the 2nd module would 
even know about the existence of that private member, it would be 
via __traits(allMembers). Thanks in advance,

Atila
Apr 25 2014