void fun( alias(?) field, alias p1, alias p2)() { if(p1.field) use(p2.field); } called with something like static foreach( list of fields){ fun!(field, p1, p2)(); }I have no idea how to specify the list of fields and I'm not sure if alias is the right "type" for the field template parameter.
Pass field as a template parameter
Ben Jones via Digitalmars-d-learn Wed, 08 May 2019 11:06:21 -0700
I'm trying to write a template function like the below... is it
possible without using string mixins?
- Pass field as a template parameter Ben Jones via Digitalmars-d-learn
- Re: Pass field as a template para... Paul Backus via Digitalmars-d-learn