Skip to content

Commit

Permalink
Fix trivial regression in lockstep caused by DMD enforcing const more…
Browse files Browse the repository at this point in the history
… strictly.
  • Loading branch information
dsimcha committed Dec 5, 2011
1 parent 9a10467 commit 36fc2fb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion std/range.d
Expand Up @@ -3522,7 +3522,7 @@ private string lockstepApply(Ranges...)(bool withIndex) if (Ranges.length > 0)
{
static if (!hasLvalueElements!Range) {
// Don't have lvalue access.
ret ~= "\tElementType!(R[" ~ to!string(ti) ~ "]) front" ~
ret ~= "\tUnqual!(ElementType!(R[" ~ to!string(ti) ~ "])) front" ~
to!string(ti) ~ ";\n";
}
}
Expand Down Expand Up @@ -3764,6 +3764,13 @@ unittest {
// Make sure we've worked around the relevant compiler bugs and this at least
// compiles w/ >2 ranges.
lockstep(foo, foo, foo);

// Make sure it works with const.
const(int[])[] foo = [[1, 2, 3]];
const(int[])[] bar = [[4, 5, 6]];
auto c = chain(foo, bar);

foreach(f, b; lockstep(c, c)) {}
}

/**
Expand Down

0 comments on commit 36fc2fb

Please sign in to comment.