I'll be back soon

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 10 05:43:44 PDT 2016


On Wednesday, 10 August 2016 at 10:33:11 UTC, Martin Nowak wrote:
>
> Overloads from different modules don't conflict when it's not 
> possible to one of them. So if all of ndslice.algorithm 
> functions only work with ndslices, and none of std.algorithm 
> functions work with ndslices, you're fine.
> I'd even consider forwarding std.algorithm.searching.find to 
> ndslice.algorithm.find a better solution than adding awkward 
> prefixes that look like we're using C.
>
> I haven't yet used ndslice much though.

Below is from the pull request. The nd functions are slightly 
different and someone might want to use the std.algorithm 
behavior with ndslices.

Original matrix

0 1 2
3 4 5
6 7 8

map for 2D case

The result is random access range.

fun(0 1 2)
fun(3 4 5)
fun(6 7 8)

ndmap for 2D case

The result is 2D slice, all operations on slices can be used.

fun(0) fun(1) fun(2)
fun(3) fun(4) fun(5)
fun(6) fun(7) fun(8)



More information about the Digitalmars-d mailing list