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)
{
Something like mixin("__traits(getProtection, A."~member~")")
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
You iterate over string literals:
https://dlang.org/spec/traits.html#allMembers
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();