On 07/24/2012 07:42 AM, Stuart wrote:

> You mean it's already supported? Nice! Although, It'd still be awesome
> to be able to do things like:
>
> auto a,b = bar();
>
> auto c,_ = bar();
>

Works in foreach loops:

    foreach (a, b; hasTupleElements)

The element type of the following range of map results is a tuple:

import std.stdio;
import std.algorithm;

void main()
{
    auto values = [1.25, 2.50, 3.75];
    auto results = map!(a => a / 4, a => a * 10)(values);

    writeln(" Quarters  Ten Times");

    foreach (quarterResult, tenTimesResult; results) {
        writefln("%8.2f%8.2f", quarterResult, tenTimesResult);
    }
}

Ali

Reply via email to