splitter, compilation issue
Ali Çehreli via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Oct 27 14:45:10 PDT 2015
On 10/27/2015 01:58 PM, sigod wrote:
> Here's simple code:
>
> import std.algorithm;
> import std.array;
> import std.file;
>
> void main(string[] args)
> {
> auto t = args[1].readText()
> .splitter('\n')
> .filter!(e => e.length)
> .split("---")
> ;
> }
>
> Looks like it should work
split's documentation says that it requires a ForwardRange but the
output of filter is an InputRange. (I can't imagine now why split has
that requirement.)
Ali
More information about the Digitalmars-d-learn
mailing list