Re: How do you find the struct types in a module? - getting Error: unknown

2020-02-13 Thread aliak via Digitalmars-d-learn
On Thursday, 13 February 2020 at 15:38:37 UTC, Steven Schveighoffer wrote: On 2/13/20 9:47 AM, aliak wrote: [...] Not sure about your error, but here is a working version (don't use mixins, use __traits(getMember)): import std.meta; template ListOfStructs(alias mod) { enum

Re: How do you find the struct types in a module? - getting Error: unknown

2020-02-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/13/20 9:47 AM, aliak wrote: Hi, I'm trying to get a typed list of structs in my current module that matches certain criteria. Something like: module mod; struct X {} struct Y {} alias allTypes = ListOfTypes!mod; But I'm having a bit of trouble. I have this so far: template

How do you find the struct types in a module? - getting Error: unknown

2020-02-13 Thread aliak via Digitalmars-d-learn
Hi, I'm trying to get a typed list of structs in my current module that matches certain criteria. Something like: module mod; struct X {} struct Y {} alias allTypes = ListOfTypes!mod; But I'm having a bit of trouble. I have this so far: template ListOfTypes(alias T) { import std.meta;