How to find all modules in a package?

Domain dont_email at empty.com
Thu Aug 4 07:22:04 UTC 2022


On Wednesday, 3 August 2022 at 12:27:32 UTC, frame wrote:
> 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.

This give me all symbols in the package.d file.


More information about the Digitalmars-d-learn mailing list