Reputation: 12138
Is there a higher-order range pattern that concatenates two or more InputRanges
?
Something like
foreach (e; a) {
// do stuff with e
}
foreach (e; b) {
// do stuff with e
}
...
should instead be written as
foreach (e; someMagic(a, b, ...)) {
// do stuff with e
}
Upvotes: 3
Views: 55
Reputation: 25595
someMagic is chain from std.range: http://dlang.org/phobos/std_range.html#chain
Upvotes: 6