On Saturday, 23 August 2014 at 01:56:06 UTC, Dicebot wrote:
On Saturday, 23 August 2014 at 01:32:13 UTC, Meta wrote:
On Saturday, 23 August 2014 at 01:24:10 UTC, Meta wrote:
What is happening here? Are these two extra ulongs the offsets of the fields in the struct?

And I just realized that that's obviously not the case. It's just an iteration variable. Problem solved.

It is same with arrays:

int[] arr = [ 1, 2, 3 ];

// ok, iterates elements
foreach (elem; arr) { }

// also ok, iterates elements + counts current index
foreach (index, elem; arr) { }

Yeah, I got confused as I expected

        foreach (val1, val2; test.tupleof)
        {
                //...
        }

To destructure the result of test.tupleof, but I just got an iteration variable instead.

Reply via email to