Skip to content

Commit a018ff2

Browse files
committed
add map primitives for "a" nury fun
1 parent 5365b64 commit a018ff2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

source/mir/ndslice/topology.d

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,19 @@ template map(fun...)
23962396
{
23972397
return slice;
23982398
}
2399+
2400+
/// ditto
2401+
auto map(T)(T[] array)
2402+
{
2403+
return array.sliced;
2404+
}
2405+
2406+
/// ditto
2407+
auto map(T)(T withAsSlice)
2408+
if (hasAsSlice!T)
2409+
{
2410+
return withAsSlice.asSlice;
2411+
}
23992412
}
24002413
else alias map = .map!(naryFun!fun);
24012414
}

0 commit comments

Comments
 (0)