On Friday, 19 March 2021 at 07:14:46 UTC, Jack wrote:
give below template struct, how can I list the members x, y and z? I've tried something with OriginalType and TemplateOf but no luck... it seems if I do foo!"str1" the "str1" became "part of type"? give .stringof from typeof(__traits(getMember, foo, field)) I thought the type would be foo!string or something.
You want std.traits.isInstanceOf: static if(!isType!m && isInstanceOf!(foo, typeof(m)))