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

           Summary: Definition of isOutputList warped due to "put"
                    implementation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: monarchdo...@gmail.com


--- Comment #0 from monarchdo...@gmail.com 2012-07-31 04:22:05 PDT ---
This is a copy paste from the forum. It was originally written as both an
analysis and a proposed solution to a problem.

TL;DR:
"put" allows placing a range of objects inside an output range, which warps the
definition of "isOutputRange" The exact kind of errors it creates is this:

----
alias int[] A; alias int[] B;
A a = new int[](2);
B b = new int[](1);
assert(isOutputRange!(B, A));
if(!b.empty)
  b.put(a);
----
Here b is not empty as output range of A object, b is not empty, yet putting a
inside b creates an empty range exception.

But more generally, the entire problem lies with the fact that B is NOT an
output range of A objects.

Please find the original abstract in the next post.

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

Reply via email to