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.
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
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
actio
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
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
actio
On Fri, May 23, 2014 at 8:44 AM, monarch_dodra via Digitalmars-d-learn
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 don't think there will be
> any
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.
allMembers yields the names of all the members. Try .tupleof on
an object instead, that might work better.
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