I have this small program here

test.d:
```
import std;
string doSomething(string[] servers, string user) {
    return user ~ servers[0];
}
void main() {
    auto servers = ["s1", "s2", "s3"];
    auto users = ["u1", "u2", "u3"];
    writeln(map!(user => servers.doSomething(user))(users));
    writeln(taskPool.amap!(user => servers.doSomething(user))(users));
}
```

The first map just works as expected, for the parallel amap though fromo (https://dlang.org/phobos/std_parallelism.html) I get the following warning with dmd:

```
/Users/.../dlang/dmd-2.096.1/osx/bin/../../src/phobos/std/parallelism.d(1711): Deprecation: function `test.main.amap!(string[]).amap` function requires a dual-context, which is deprecated
```

for ldc the build fails with:
```
/Users/.../dlang/ldc-1.26.0/bin/../import/std/parallelism.d(1711): Deprecation: function `test.main.amap!(string[]).amap` function requires a dual-context, which is deprecated
test.d(9):        instantiated from here: `amap!(string[])`
/Users/.../dlang/ldc-1.26.0/bin/../import/std/parallelism.d(1711): Error: function `test.main.amap!(string[]).amap` requires a dual-context, which is not yet supported by LDC
```


Thanks in advance for you insights,
Christian
  • How to work around the infamo... Christian Köstlin via Digitalmars-d-learn

Reply via email to