On Monday, 17 July 2017 at 19:11:26 UTC, H. S. Teoh wrote:
Hmm, since we already have sumOfLengths available at
compile-time, what about:
T[sumOfLengths!StaticArrays]
append(StaticArrays...)(StaticArrays arrays)
if (allSatisfy!(isStaticArray, StaticArrays))
{
typeof(return) result = void;
foreach (i, a; 0 .. arrays.length)
{
enum offset = sumOfLengths!(arrays[0 .. i]);
result[offset .. offset + a.length] = a[];
}
return result;
}
T
Thanks, I'll try this!
Does this have a place in Phobos?
If so,
- under what name: append, concat or cat?
- where: std.algorithm or std.array?