flatten

flatten
(
size_t N = size_t.max
R
)
(
R r
)
if (
isInputRange!R
)

Examples

1 auto d1 = [0, 1, 2, 3, 4, 5, 6, 7, 8];
2 assert(equal(d1.flatten, d1));
3 assert(equal(d1.flatten!0, d1));
4 
5 auto d2 = [[0, 1], [], [2, 3], [4, 5, 6, 7], [8]];
6 assert(equal(d2.flatten, d1));
7 assert(equal(d2.flatten!1, d1));
8 assert(equal(d2.flatten!0, d2));
9 
10 auto d3 = [[[0, 1], [], [2, 3]], [[4, 5, 6, 7], [8]]];
11 assert(equal(d3.flatten, d1));
12 assert(equal(d3.flatten!0, d3));
13 assert(equal(d3.flatten!1, d2));
14 assert(equal(d3.flatten!2, d1));

Meta