Hi all,
the last foreach in the following code does not compile... Is this a bug, or is something wrong with my syntax?

void main()
{
        import std.parallelism : parallel;
        import std.range : iota;
        
        foreach(i; iota(0, 5)){}
        foreach(i; staticIota!(0, 5)){}
        foreach(i; parallel(iota(0, 5))){}
        foreach(i; parallel(staticIota!(0, 5))){}
}

// copied from core.internal.traits
template staticIota(int beg, int end)
{
        import std.typetuple;
    static if (beg + 1 >= end)
    {
        static if (beg >= end)
        {
            alias staticIota = TypeTuple!();
        }
        else
        {
            alias staticIota = TypeTuple!(+beg);
        }
    }
    else
    {
        enum mid = beg + (end - beg) / 2;
alias staticIota = TypeTuple!(staticIota!(beg, mid), staticIota!(mid, end));
    }
}

Reply via email to