Re: Protection attribute in another module

2017-08-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:15:56 UTC, Kagamin wrote: Something like mixin("__traits(getProtection, A."~member~")") The following compiles without error. It would be nice if something like this got added to std.traits. template getProtection(string from, string member) {

Re: Protection attribute in another module

2017-08-30 Thread Kagamin via Digitalmars-d-learn
Something like mixin("__traits(getProtection, A."~member~")")

Re: Protection attribute in another module

2017-08-29 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 15:48:05 UTC, Kagamin wrote: You iterate over string literals: https://dlang.org/spec/traits.html#allMembers I had known that, but I couldn't figure out how to get the identifiers. It turns out that I can loop over getOverloads and it produces the desired result

Re: Protection attribute in another module

2017-08-29 Thread Kagamin via Digitalmars-d-learn
You iterate over string literals: https://dlang.org/spec/traits.html#allMembers

Protection attribute in another module

2017-08-28 Thread jmh530 via Digitalmars-d-learn
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();