How to use libmir --> mir-algorithm, numir, mir-random?

jmh530 john.michael.hall at gmail.com
Wed Sep 9 15:47:35 UTC 2020


On Wednesday, 9 September 2020 at 15:30:33 UTC, Shaleen Chhabra 
wrote:
> [snip]
>
> Hi, I updated my dmd version to dmd-2.093.1
> Now it throws a conflict error between
>
> 1. function mir.ndslice.topology.iota!(long, 1LU).iota at 
> mir/ndslice/topology.d(630) conflicts with function 
> std.range.iota!int.iota at 
> /home/shaleen/.dvm/compilers/dmd-2.093.1/linux/bin/../../src/phobos/std/range/package.d
>
> 2. template mir.ndslice.topology.map(fun...) if (fun.length) at 
> mir/ndslice/topology.d(2565) conflicts with template 
> std.algorithm.iteration.map(fun...) if (fun.length >= 1) at 
> /home/shaleen/.dvm/compilers/dmd-2.093.1/linux/bin/../../src/phobos/std/algorithm/iteration.d(482)

Below would generate the same error for iota. There are iota 
functions in std.range and mir.ndslice.topology and the compiler 
does not know which one to use. You can use one or the other or 
use static imports.

In the future, it will be a little easier to identify the issues 
if you post the code as well. You can also start with simpler 
examples and work your way to larger ones.

```
/+dub.sdl:
dependency "mir-algorithm" version="*"
+/
import std.range;
import mir.ndslice.topology;

void main()
{
     auto x = iota(5);
}
```


More information about the Digitalmars-d-learn mailing list