mir: How to change iterator?

jmh530 john.michael.hall at gmail.com
Thu Apr 16 20:59:36 UTC 2020


On Thursday, 16 April 2020 at 19:59:57 UTC, Basile B. wrote:
> [snip]
>
> And remove the extra assert() BTW... I don't know why this is 
> accepted.

Thanks, I hadn't realized about approxEqual. I think that 
resolves my near-term issue, I would need to play around with 
things a little more to be 100% sure though.

That being said, I'm still unsure of what I would need to do to 
get the following code to compile.

/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.28"
+/

import mir.ndslice;

void foo(Iterator, SliceKind kind)(Slice!(Iterator, 1, kind) x, 
Slice!(Iterator, 1, kind) y) {
     import std.stdio : writeln;
     writeln("here");
}

void main() {
     auto x = [0.5, 0.5].sliced(2);
     auto y = x * 5.0;
     foo(x, y);
}


More information about the Digitalmars-d-learn mailing list