Re: Getting all types defined in a module at compile time

2019-11-18 Thread Ben Jones via Digitalmars-d-learn
On Tuesday, 19 November 2019 at 01:55:17 UTC, Paul Backus wrote: On Monday, 18 November 2019 at 21:48:00 UTC, Ben Jones wrote: template notmodule(alias T){ alias notmodule = __traits(isModule, T); } [...] I get errors: ``` (on the alias notmodule line) Error: trait isModule is either inv

Re: Getting all types defined in a module at compile time

2019-11-18 Thread Paul Backus via Digitalmars-d-learn
On Monday, 18 November 2019 at 21:48:00 UTC, Ben Jones wrote: template notmodule(alias T){ alias notmodule = __traits(isModule, T); } [...] I get errors: ``` (on the alias notmodule line) Error: trait isModule is either invalid or not supported in alias ``` The result of __traits(isMod

Getting all types defined in a module at compile time

2019-11-18 Thread Ben Jones via Digitalmars-d-learn
I'm trying to get a list of all the types defined in a module at compile time (enums, structs, classes). I attempted to use the isAggregateType trait, but it choked when it was passed modules that had been imported (object, and the others explicitly imported). My next attempt was to try to f