On Friday, 23 May 2014 at 01:17:18 UTC, bioinfornatics wrote:
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
On Fri, May 23, 2014 at 8:44 AM, monarch_dodra via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 23 May 2014 at 01:17:18 UTC, bioinfornatics wrote:
I would like to get struct's members and zip them with an action
tupleof will do what you need (mostly). However, I
On Friday, 23 May 2014 at 08:20:05 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Fri, May 23, 2014 at 8:44 AM, monarch_dodra via
Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 23 May 2014 at 01:17:18 UTC, bioinfornatics wrote:
I would like to get struct's
On Friday, 23 May 2014 at 08:20:05 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
On Fri, May 23, 2014 at 8:44 AM, monarch_dodra via
Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Friday, 23 May 2014 at 01:17:18 UTC, bioinfornatics wrote:
I would like to get struct's
On Friday, 23 May 2014 at 01:17:18 UTC, bioinfornatics wrote:
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
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
allMembers yields the names of all the members. Try .tupleof on
an object instead, that might work better.