Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InputRange Concatenation

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
}
like image 246
Nordlöw Avatar asked Dec 07 '25 00:12

Nordlöw


1 Answers

someMagic is chain from std.range: http://dlang.org/phobos/std_range.html#chain

like image 53
Adam D. Ruppe Avatar answered Dec 09 '25 17:12

Adam D. Ruppe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!