This works:
foreach (i;0..n) { data ~= r.front; r.popFront(); }
but looks a little bit arkward. I came up with this now:
data = r.take(n).array;
This works partly, because the values of r are not consumed. So I have to call afterwards:
r = r.drop(n);
Now I wonder, if it is possible to do this with one single call, something like
data = r.take_consuming(n).array; Does there something like this exist?