The code example at https://dlang.org/phobos/std_parallelism.html

containing:


import std.algorithm, std.parallelism, std.range;

void main() {
    immutable n = 1_000_000_000;
    immutable delta = 1.0 / n;

    real getTerm(int i)
    {
        immutable x = ( i - 0.5 ) * delta;
        return delta / ( 1.0 + x * x ) ;
    }

    immutable pi = 4.0 * taskPool.reduce!"a + b"(
        std.algorithm.map!getTerm(iota(n))
    );
}

fails to compile as

std/parallelism.d(2632,36): Error: function std.parallelism.TaskPool.reduce!"a + b".reduce!(MapResult!(getTerm, Result)).reduce cannot get frame pointer to D main

on Git master.

Why?

Is there a solution?

Reply via email to