joiner

fnauto joiner(RoR, Separator)(RoR r, Separator sep)

Lazily joins a range of ranges with a separator. The separator itself is a range. If a separator is not provided, then the ranges are joined directly without anything in between them (often called flatten in other languages).

Parameters

rAn input range of input ranges to be joined.
sepA forward range of element(s) to serve as separators in the joined range.

Returns

A range of elements in the joined range. This will be a bidirectional range if

both outer and inner ranges of RoR are at least bidirectional ranges. Else if both outer and inner ranges of RoR are forward ranges, the returned range will be likewise. Otherwise it will be only an input range. The

range bidirectionality

is propagated if no separator is specified.

See_also:

chain, which chains a sequence of ranges with compatible elements

into a single range.

Note

When both outer and inner ranges of RoR are bidirectional and the joiner is

iterated from the back to the front, the separator will still be consumed from front to back, even if it is a bidirectional range too.

fnauto joiner(RoR)(RoR r) if (isInputRange!RoR && isInputRange!(Unqual!(ElementType!RoR)))

Ditto