learncrypto/source/utility.d

14 lines
293 B
D

module utility;
auto concat(T : E[n], E, size_t n)(in E[][] args...) @nogc
{
size_t offset = 0;
T result = void;
foreach(arr; args) {
result[offset .. offset+arr.length] = arr;
offset += arr.length;
}
assert(offset == result.length);
return result;
}