missing: __traits(isPublic (private, etc...)

Adam Ruppe destructionator at gmail.com
Mon Jun 20 05:52:28 PDT 2011


Indeed, this would be nice. I want it for my web.d thing.

But, as far as I know, there's no way to get it at all right now.

A while ago, I tried to add it to the compiler. The problem is
protection is stored with the symbol itself, not the thingy returned
by getMember - that's always considered public by the compiler.

So if you pass the actual Class.member, it's easy to see if it's
public or not, but the getMember doesn't say.

(Which is why it compiles in the first place... otherwise the private
members would give visibility errors when you tried to use it there.)


In the compiler, if there was an informational field for protection
added, the trait could be made to work, but I haven't gotten
around to trying to patch that yet and afaik no one else is interested
enough to look either.


More information about the Digitalmars-d-learn mailing list