How to get struct's members ?
bioinfornatics via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu May 22 18:17:17 PDT 2014
Dear,
I would like to get struct's members and zip them with an action
as
struct A
{
int a;
int b;
}
std.range.zip( __traits( allmembers, A ), [(x) => x == 0, (y) =>
y > 3] );
like this i could apply an action to each field.
I tried this:
http://dpaste.dzfl.pl/747799ffa64e
but:
tuple get by allmembers is not an input rage then i can't to use
zip
allmembers return both fiels and method while i would like only
fields
thanks
More information about the Digitalmars-d-learn
mailing list