The reason is that joiner does not only consume its range argument, it eats every item of every item of the range argument (which must be a range of ranges). Therefore, it destructively chews through its input.

Andrei

David Simcha wrote:
Why is std.algorithm.joiner explicitly *not* a forward range even when it can be? This is not an oversight. It appears to be an explicit decision. From the unittest:

    static assert(isInputRange!(typeof(joiner([""], ""))));
    static assert(!isForwardRange!(typeof(joiner([""], ""))));

Maybe I'm missing something obvious, but I just can't think of any good reason for this decision.


------------------------------------------------------------------------

_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to