chunks equivalent with unpacking?

Ali Çehreli acehreli at yahoo.com
Wed Jul 31 11:03:36 PDT 2013


On 07/31/2013 10:58 AM, Andrej Mitrovic wrote:
> On 7/31/13, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
>> Can it? I've tried alternatively with opApply but it's problematic to
>> support both ref/non-ref argument versions.
>
> Ajh nevermind there's no issue with ref-ness, I just had a bug in my
> code. So this is easily implementable with opApply but I'm not sure
> how it can be done with a range type.
>

Once the element type is a tuple, 'tuple foreach' will expand them.

     foreach (x, y, z, w; /* a range that returns tuple of four */)

Ali



More information about the Digitalmars-d-learn mailing list