D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3439 - std.range.Sequence.opIndex not consistent after calling popFront().
Summary: std.range.Sequence.opIndex not consistent after calling popFront().
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-24 16:22 UTC by David Simcha
Modified: 2015-06-09 01:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2009-10-24 16:22:32 UTC
import std.stdio, std.range;

void main() {
    auto odds = sequence!("a.field[0] + n * a.field[1]")(1, 2);
    writeln(odds.front, '\t', odds[0]);  // 1    1

    odds.popFront;
    writeln(odds.front, '\t', odds[0]);  // 3    1

    odds.popFront;
    writeln(odds.front, '\t', odds[0]);  // 5    1
}
Comment 1 David Simcha 2010-06-17 18:46:57 UTC
Fixed SVN.