www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13171] New: std.algorithm.until(range, sentinel,

https://issues.dlang.org/show_bug.cgi?id=13171

          Issue ID: 13171
           Summary: std.algorithm.until(range, sentinel, OpenRight.no)
                    doesn't propagate popping of sentinel to range
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: nilsbossung googlemail.com

import std.algorithm;
import std.range;
void main()
{
    auto a = [1, 2, 3, 4];
    assert(equal(refRange(&a).until(3, OpenRight.no), [1, 2, 3])); /* passes */
    assert(a == [4]); /* fails, should pass */
}

Pull request is on the way.

--
Jul 20 2014