[Issue 8061] std.algorithm.joiner breaks when used with InputRangeObject

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 9 02:42:20 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8061


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #2 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-05-09 02:43:39 PDT ---
Hmmm. Well, joiner takes a range of _input ranges_, not forward ranges, so it
_can't_ use save on the inner ranges (though it does define save if the input
ranges happen to be forward ranges).

This assertion passes:

    assert(equal(joiner([inputRangeObject("ab"), inputRangeObject("cd")]),
                 "abcd"));

So, it would seem that the problem is in std.conv.to. It's probably assuming
that passing the range results in a copy (since it does with most ranges).

Truth be told, most range-based functions in Phobos aren't properly tested to
make sure that they work with ranges which are input ranges rather than forward
ranges or that they work with forward ranges which aren't copied when being
passed to functions.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list