learncrypto/source/utility.d

15 lines
293 B
D
Raw Normal View History

2016-07-05 20:34:52 +02:00
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;
}