How to find all modules in a package?

frame frame86 at live.com
Wed Aug 3 12:27:32 UTC 2022


On Wednesday, 3 August 2022 at 03:36:55 UTC, Domain wrote:
> I want to find out all public functions in all modules in a 
> package. Can I do that at compile time?

You can do something like that:

```d
static foreach (sym; __traits(allMembers, mixin("std.string")))
{
     pragma(msg, sym.stringof);
}
```

Then you would have to check if `sym` is a template or function 
or something else.


More information about the Digitalmars-d-learn mailing list