-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
staticArray does not compile when string with:
mir-core\source\mir\functional.d(57,12): Error: returning
a
escapes a reference to variadic parametera
The code below compiles, removing the comment doesn't.
import mir.functional: staticArray;
import mir.ndslice;
auto resuF = mir.ndslice.cartesian([0,1,2], [0,1], [4,5,6]).flattened.map!staticArray;
writeln(resuF);
auto resuS = mir.ndslice.cartesian(["A", "B"], ["c","b"]).flattened;//.map!staticArray;
writeln(resuS);
Replacing current staticArray (in mir.functional) with code below works:
T[N] staticArray(T, size_t N)(T[N] a...)
if (!is(T == string)) {
return a;
}
T[N] staticArray(T, size_t N)(T[N] a...)
if (is(T == string)) {
T[N] ret;
static foreach(i; 0..a.length) ret[i] = a[i];
return ret;
}
Metadata
Metadata
Assignees
Labels
No labels